Skip to content

Commit

Permalink
minor: improve test_dist_missing_data: doc, assert ret first (#325)
Browse files Browse the repository at this point in the history
Asserting the return value first helps in case it is 120 due to
Coverage.py not being installed correctly.
  • Loading branch information
blueyed committed Aug 18, 2019
1 parent 6dc54b1 commit e6193fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_pytest_cov.py
Expand Up @@ -859,6 +859,7 @@ def test_invalid_coverage_source(testdir):
@pytest.mark.skipif("'dev' in pytest.__version__")
@pytest.mark.skipif('sys.platform == "win32" and platform.python_implementation() == "PyPy"')
def test_dist_missing_data(testdir):
"""Test failure when using a worker without pytest-cov installed."""
venv_path = os.path.join(str(testdir.tmpdir), 'venv')
virtualenv.create_environment(venv_path)
if sys.platform == 'win32':
Expand Down Expand Up @@ -887,10 +888,10 @@ def test_dist_missing_data(testdir):
'--max-slave-restart=0',
script)

assert result.ret == 0
result.stdout.fnmatch_lines([
'*- coverage: failed slaves -*'
])
assert result.ret == 0


def test_funcarg(testdir):
Expand Down

0 comments on commit e6193fd

Please sign in to comment.