Merge pull request #5665 from hroncok/i5664
In test_xfail_handling, only remove __pycache__ if it exists
This commit is contained in:
		
						commit
						fd2fb36eac
					
				|  | @ -0,0 +1,2 @@ | ||||||
|  | When invoking pytest's own testsuite with ``PYTHONDONTWRITEBYTECODE=1``, | ||||||
|  | the ``test_xfail_handling`` test no longer fails. | ||||||
|  | @ -207,7 +207,8 @@ def test_xfail_handling(testdir): | ||||||
| 
 | 
 | ||||||
|     # because we are writing to the same file, mtime might not be affected enough to |     # because we are writing to the same file, mtime might not be affected enough to | ||||||
|     # invalidate the cache, making this next run flaky |     # invalidate the cache, making this next run flaky | ||||||
|     testdir.tmpdir.join("__pycache__").remove() |     if testdir.tmpdir.join("__pycache__").exists(): | ||||||
|  |         testdir.tmpdir.join("__pycache__").remove() | ||||||
|     testdir.makepyfile(contents.format(assert_value="0", strict="True")) |     testdir.makepyfile(contents.format(assert_value="0", strict="True")) | ||||||
|     result = testdir.runpytest("--sw", "-v") |     result = testdir.runpytest("--sw", "-v") | ||||||
|     result.stdout.fnmatch_lines( |     result.stdout.fnmatch_lines( | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue