Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestPyCacheDir.test_sys_pycache_prefix_integration fails on Windows / Python 3.9 #9298

Open
The-Compiler opened this issue Nov 11, 2021 · 4 comments
Labels
platform: windows windows platform-specific problem topic: rewrite related to the assertion rewrite mechanism type: selftests a problem in the tests of pytest

Comments

@The-Compiler
Copy link
Member

See https://github.com/pytest-dev/pytest/actions/runs/1448359677 and https://github.com/pytest-dev/pytest/actions/runs/1449499760:

        # test file: rewritten, custom pytest cache tag
        test_foo_pyc = get_cache_dir(test_foo) / ("test_foo" + PYC_TAIL)
>       assert test_foo_pyc.is_file()
E       AssertionError: assert False
E        +  where False = <bound method Path.is_file of WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/pope...n/pytest-0/popen-gw0/test_sys_pycache_prefix_integration0/src/test_foo.cpython-39-pytest-7.0.0.dev312+g17b38259f.pyc')>()

#9294 was a doc-fix only though... Test introduced in #5864 for #4730.

@The-Compiler The-Compiler added platform: windows windows platform-specific problem topic: rewrite related to the assertion rewrite mechanism type: selftests a problem in the tests of pytest labels Nov 11, 2021
@nicoddemus
Copy link
Member

Hmm unfortunately I cannot reproduce it locally, it works for me on Python 3.9.8...

Perhaps we should mark it as xfail for now? Better than having this breaking on CI.

@RonnyPfannschmidt
Copy link
Member

output indicates a bug in get_cache_dir

i don't see a __pycache__ in the filename

@RonnyPfannschmidt
Copy link
Member

@The-Compiler @nicoddemus i realized the issue - the test monkeypatche sys instead of the enviroment variables, which breaks for subprocess based running

RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Nov 16, 2021
@RonnyPfannschmidt
Copy link
Member

my hypothesis turned out wrong

RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Nov 17, 2021
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Nov 17, 2021
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: windows windows platform-specific problem topic: rewrite related to the assertion rewrite mechanism type: selftests a problem in the tests of pytest
Projects
None yet
Development

No branches or pull requests

3 participants