tests: use sys.dont_write_bytecode
Setting PYTHONDONTWRITEBYTECODE in the environment does not change it for the current process.
This commit is contained in:
parent
99f487864c
commit
1abb08d52f
|
@ -253,7 +253,7 @@ def test_cache_show(testdir):
|
|||
|
||||
class TestLastFailed:
|
||||
def test_lastfailed_usecase(self, testdir, monkeypatch):
|
||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
|
||||
monkeypatch.setattr("sys.dont_write_bytecode", True)
|
||||
p = testdir.makepyfile(
|
||||
"""
|
||||
def test_1():
|
||||
|
@ -345,7 +345,7 @@ class TestLastFailed:
|
|||
result.stdout.no_fnmatch_line("*test_a.py*")
|
||||
|
||||
def test_lastfailed_difference_invocations(self, testdir, monkeypatch):
|
||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
|
||||
monkeypatch.setattr("sys.dont_write_bytecode", True)
|
||||
testdir.makepyfile(
|
||||
test_a="""\
|
||||
def test_a1():
|
||||
|
@ -379,7 +379,7 @@ class TestLastFailed:
|
|||
result.stdout.fnmatch_lines(["*1 failed*1 desel*"])
|
||||
|
||||
def test_lastfailed_usecase_splice(self, testdir, monkeypatch):
|
||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
|
||||
monkeypatch.setattr("sys.dont_write_bytecode", True)
|
||||
testdir.makepyfile(
|
||||
"""\
|
||||
def test_1():
|
||||
|
|
Loading…
Reference in New Issue