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:
|
class TestLastFailed:
|
||||||
def test_lastfailed_usecase(self, testdir, monkeypatch):
|
def test_lastfailed_usecase(self, testdir, monkeypatch):
|
||||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
|
monkeypatch.setattr("sys.dont_write_bytecode", True)
|
||||||
p = testdir.makepyfile(
|
p = testdir.makepyfile(
|
||||||
"""
|
"""
|
||||||
def test_1():
|
def test_1():
|
||||||
|
@ -345,7 +345,7 @@ class TestLastFailed:
|
||||||
result.stdout.no_fnmatch_line("*test_a.py*")
|
result.stdout.no_fnmatch_line("*test_a.py*")
|
||||||
|
|
||||||
def test_lastfailed_difference_invocations(self, testdir, monkeypatch):
|
def test_lastfailed_difference_invocations(self, testdir, monkeypatch):
|
||||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
|
monkeypatch.setattr("sys.dont_write_bytecode", True)
|
||||||
testdir.makepyfile(
|
testdir.makepyfile(
|
||||||
test_a="""\
|
test_a="""\
|
||||||
def test_a1():
|
def test_a1():
|
||||||
|
@ -379,7 +379,7 @@ class TestLastFailed:
|
||||||
result.stdout.fnmatch_lines(["*1 failed*1 desel*"])
|
result.stdout.fnmatch_lines(["*1 failed*1 desel*"])
|
||||||
|
|
||||||
def test_lastfailed_usecase_splice(self, testdir, monkeypatch):
|
def test_lastfailed_usecase_splice(self, testdir, monkeypatch):
|
||||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
|
monkeypatch.setattr("sys.dont_write_bytecode", True)
|
||||||
testdir.makepyfile(
|
testdir.makepyfile(
|
||||||
"""\
|
"""\
|
||||||
def test_1():
|
def test_1():
|
||||||
|
|
Loading…
Reference in New Issue