Skip to content

Commit c0b46bd

Browse files
committed
Merge pull request #6 from schlamar/test-missing-data
Fixed test_dist_missing_data.
2 parents dcdc713 + b62318f commit c0b46bd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

test_pytest_cov.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
is fine with simple assignment statement.
1515
"""
1616

17+
import os
1718
import sys
1819

20+
import virtualenv
21+
1922
import py
2023
import pytest
2124

@@ -257,17 +260,17 @@ def test_empty_report(testdir):
257260
assert not matching_lines
258261

259262

260-
@pytest.mark.xfail(reason='This tests expects a Python installation without '
261-
'pytest-cov installed. Maybe we can simulate this '
262-
'with a virtualenv')
263263
def test_dist_missing_data(testdir):
264+
venv_path = os.path.join(str(testdir.tmpdir), 'venv')
265+
virtualenv.create_environment(venv_path)
266+
exe = os.path.join(venv_path, 'bin', 'python')
264267
script = testdir.makepyfile(SCRIPT)
265268

266269
result = testdir.runpytest('-v',
267270
'--cov=%s' % script.dirpath(),
268271
'--cov-report=term-missing',
269272
'--dist=load',
270-
'--tx=popen//python=%s' % sys.executable,
273+
'--tx=popen//python=%s' % exe,
271274
script)
272275

273276
result.stdout.fnmatch_lines([

tox.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
envlist = py26, py27, pypy, py32, py33, py34
33

44
[testenv]
5+
usedevelop = True
56
setenv =
67
PYTHONHASHSEED = random
7-
deps = pytest
8-
pytest-xdist
8+
deps =
9+
pytest
10+
pytest-xdist
11+
virtualenv
912
commands = py.test -v test_pytest_cov.py {posargs}

0 commit comments

Comments
 (0)