Skip to content

Commit

Permalink
Make test portable.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed May 22, 2020
1 parent fa4bb12 commit 2612d2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_pytest_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,16 +553,16 @@ def foobar(a, b):

script = testdir.makepyfile('''
import os
import tempfile
import pytest
import mod
@pytest.fixture
def bad():
if not os.path.exists('/tmp/crappo'):
os.mkdir('/tmp/crappo')
os.chdir('/tmp/crappo')
path = tempfile.mkdtemp('test_borken_cwd')
os.chdir(path)
yield
os.rmdir('/tmp/crappo')
os.rmdir(path)
def test_foobar(bad):
assert mod.foobar(1, 2) == 3
Expand Down

0 comments on commit 2612d2c

Please sign in to comment.