From acb62ba619257de8520e77bd01082f4556d2b14e Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 4 Jul 2019 21:08:16 -0300 Subject: [PATCH] Fix test_stepwise::test_xfail_handling when byte code writing is disabled --- testing/test_stepwise.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testing/test_stepwise.py b/testing/test_stepwise.py index c05d7925d..d8d11917a 100644 --- a/testing/test_stepwise.py +++ b/testing/test_stepwise.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +import sys + import pytest @@ -208,7 +210,8 @@ def test_xfail_handling(testdir): # because we are writing to the same file, mtime might not be affected enough to # invalidate the cache, making this next run flaky - testdir.tmpdir.join("__pycache__").remove() + if not sys.dont_write_bytecode: + testdir.tmpdir.join("__pycache__").remove() testdir.makepyfile(contents.format(assert_value="0", strict="True")) result = testdir.runpytest("--sw", "-v") result.stdout.fnmatch_lines(