-
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
[3.4.3] Multiple tests in TestCase fail when not run in debug - shutil.make_archive #427
Comments
Hm, your code looks good to me. The only thing that I can think of are the relative paths - have you tried with absolute paths (e.g. c:/src) instead? |
Just tried with absolute paths but this didn't make a difference. Another interesting thing to note is that when run (for my particular use case) with other tests, it then works again, it's just in isolation that this fails. I'm just working on a minimal example to share with you. |
So another one of my tests imports from pyfakefs.fake_filesystem_unittest import TestCase
import shutil, zipfile
class Test(TestCase):
def setUp(self):
self.setUpPyfakefs()
self.fs.create_file('src/file_1.txt')
self.fs.create_file('src/a/file_2.txt')
shutil.make_archive('archive', 'zip', root_dir='src')
def test_a(self):
self.assertTrue(True)
def test_b(self):
self.assertTrue(True) |
Ok, I can confirm the bug, and it happens only on Python 3.7 - so my first guess is that the implementation of zipfile or shutil has changed that causes this. I will try to understand the cause. |
Ok, this has to do with the fact that the As for the problem itself - I'm still not down to the root cause. If the module cannot be patched in |
- these module can still hold references to fake modules - modules already loaded at test start are not affected - see pytest-dev#501 and pytest-dev#427
I'm not sure if this is a bug or an issue with my approach but the following minimal test example only appears to run both tests successfully if run with the debugger using PyCharm 2018.2.3 CE on Windows 10 (Python 3.7.0).
Stack trace:
The text was updated successfully, but these errors were encountered: