diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 9a01fa9eda6..c3f8f5daea9 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -4,6 +4,7 @@ import importlib import marshal import os +import pprint import py_compile import stat import sys @@ -1734,7 +1735,7 @@ def test_sys_pycache_prefix_integration( ) -> None: """Integration test for sys.pycache_prefix (#4730).""" pycache_prefix = tmp_path / "my/pycs" - monkeypatch.setattr(sys, "pycache_prefix", str(pycache_prefix)) + monkeypatch.setattr(sys, "pycache_prefix", os.fspath(pycache_prefix)) monkeypatch.setattr(sys, "dont_write_bytecode", False) pytester.makepyfile( @@ -1748,6 +1749,8 @@ def test_foo(): } ) result = pytester.runpytest() + pprint.pprint(list(tmp_path.visit("**"))) + assert result.ret == 0 test_foo = pytester.path.joinpath("src/test_foo.py")