Skip to content

Commit acb62ba

Browse files
committed
Fix test_stepwise::test_xfail_handling when byte code writing is disabled
1 parent df0cff1 commit acb62ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

testing/test_stepwise.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- coding: utf-8 -*-
2+
import sys
3+
24
import pytest
35

46

@@ -208,7 +210,8 @@ def test_d(): pass
208210

209211
# because we are writing to the same file, mtime might not be affected enough to
210212
# invalidate the cache, making this next run flaky
211-
testdir.tmpdir.join("__pycache__").remove()
213+
if not sys.dont_write_bytecode:
214+
testdir.tmpdir.join("__pycache__").remove()
212215
testdir.makepyfile(contents.format(assert_value="0", strict="True"))
213216
result = testdir.runpytest("--sw", "-v")
214217
result.stdout.fnmatch_lines(

0 commit comments

Comments
 (0)