-
Notifications
You must be signed in to change notification settings - Fork 91
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
patch_open_code
doesn't seem to work in Python 3.12
#892
Comments
Thanks, I will have a look at it. It may be related to #836, which I haven't managed to fix yet. Now that 3.12 is released, this gets a bit more important... |
Let me know what I can do to help. For example, it doesn't look like this use case (i.e. importing modules) is covered with tests. I could open a PR to add the above code to |
Thanks - I can basically just use your code as a test, and I can reproduce the problem. |
I couldn't get it to work under Windows yet (only in the CI, locally in works), but it helped me to fix the other problem with patching |
- fixes Windows problem if called from fspath, if the real current drive is not C: - fixes test for pytest-dev#892 under Windows
- fixes Windows problem if called from fspath, if the real current drive is not C: - fixes test for #892 under Windows
Should be fixed in main now - please check! |
New version with the fix is released. |
@mrbean-bremen thanks for looking into this. I can confirm it's working 👍 |
I have a program that imports Python modules dynamically and I use
patch_open_code
in my tests. I tried running it under Python 3.12 just for fun and found the tests are not working.For example, this works in e.g. 3.11:
The test passes alright. In 3.12, however, I'm getting:
Tested under Python 3.11.6 and 3.12.0, respectively, with pytest 7.4.0 and pyfakefs 5.2.4.
The text was updated successfully, but these errors were encountered: