Skip to content

Commit 1268e7a

Browse files
committed
Some assertions were not being run when testing pip-missing-reqs. Move them so that they are run
1 parent d415d8d commit 1268e7a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ jobs:
3737
3838
- name: "Run tests"
3939
run: |
40-
# We currently require 94% test coverage and not 100% as this is the
40+
# We currently require 96% test coverage and not 100% as this is the
4141
# level that coverage was at when the CI restriction was introduced.
42-
pytest -s -vvv --cov-fail-under 94 --cov=pip_check_reqs/ --cov=tests tests/ --cov-report=xml
42+
pytest -s -vvv --cov-fail-under 96 --cov=pip_check_reqs/ --cov=tests tests/ --cov-report=xml
4343
4444
- name: "Upload coverage to Codecov"
4545
uses: "codecov/codecov-action@v1"

tests/test_find_missing_reqs.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
import pretend
99

10-
from pip_check_reqs import find_missing_reqs, common
10+
from pip_check_reqs import find_missing_reqs, common, __version__
1111

1212

1313
@pytest.fixture
@@ -85,7 +85,8 @@ def test_main_failure(monkeypatch, caplog, fake_opts):
8585

8686
with pytest.raises(SystemExit) as excinfo:
8787
find_missing_reqs.main()
88-
assert excinfo.value == 1
88+
89+
assert excinfo.value.code == 1
8990

9091
assert caplog.records[0].message == \
9192
'Missing requirements:'
@@ -103,7 +104,8 @@ def test_main_no_spec(monkeypatch, caplog, fake_opts):
103104

104105
with pytest.raises(SystemExit) as excinfo:
105106
find_missing_reqs.main()
106-
assert excinfo.value == 2
107+
108+
assert excinfo.value.code == 2
107109

108110
assert fake_opts.error.calls
109111

@@ -158,4 +160,5 @@ def test_main_version(monkeypatch, caplog, fake_opts):
158160

159161
with pytest.raises(SystemExit) as excinfo:
160162
find_missing_reqs.main()
161-
assert excinfo.value == 'version'
163+
164+
assert str(excinfo.value) == __version__

0 commit comments

Comments
 (0)