-
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
Crash with pytest-subtests in Windows #912
Comments
Thanks, I will have a look later tonight! |
Ok, this is a problem with skipping modules (in this case the I also tried to not skip the I haven't thought yet of a workaround that could be used meanwhile (other than avoiding to emulate another os, of course), sorry... |
No pressure. take your time. Thanks for the quick response. If you need some change in pytest-subtests, here's a link to their Issue tracker. |
Turns out I was mistaken - this isn't complicated at all. |
- the tempfile module will access the temp path using Windows separators under Windows, even if emulating Posix - this had to be handled - fixes pytest-dev#912
- the tempfile module will access the temp path using Windows separators under Windows, even if emulating Posix - this had to be handled - fixes #912
@JakobDev: Should be fixed in main now - can you please check if this fixes it for you? |
I have tested it, It no longer crashes, but it still not works correctly. Take this example: import pytest_subtests
import pyfakefs
import os
def test_subtest(subtests: pytest_subtests.SubTests, fs: pyfakefs.fake_filesystem.FakeFilesystem) -> None:
fs.os = pyfakefs.fake_filesystem.OSType.LINUX
with subtests.test("Test1"):
assert os.path.abspath("/test.txt") == "/test.txt"
with subtests.test("Test2"):
assert os.path.abspath("/test.txt") == "/test.txt"
|
Ok, thanks - I will have a look. |
That is actually another problem that is caused by a recent fix for #904. Patching is now paused at reporting start and resumed before the next test, but with subtests, the resume does not happen, because the respective hook is not called. Maybe I should check for another hook... |
It was actually an incorrect fix for the other issue that caused that - should have read the pytest documentation better... Please check if it works for you now in main. |
Unfortunately the error still exists. |
Hm, that's strange, I thought I had tested this... well, another round tonight, sorry. Just to be clear: the test above with the two subtests still fails in the same way, right? |
Yes Console Log
|
Hm, I really cannot reproduce this. I tried to copy your environment as far as I can see, and I get:
To make sure, I also installed pyfakefs from GitHub as you did. SO, at the moment I'm stumped... can you think of anything else in your environment that may influence that? |
Interesting. I now tried to uninstall pyfakefs before installing it from git and it works. It looks like pip have not installed the package before for some reason. Maybe |
Ah, that's good to hear! I was out of ideas here... |
The release is out. |
Describe the bug
I'm trying to use pyfakefs together with pytest-subtests. It works without any problems in Linux, but when I tested it on Windows, it just crashes. I'm not sure if I should report it here or on the pytest-subtests, but error points to pyfakefs, so I report it here.
How To Reproduce
Execute this test in Windows:
Full Error
Your environment
Please run the following in the environment where the problem happened and
paste the output.
The text was updated successfully, but these errors were encountered: