Permalink
Browse files

Import zipfile to avoid problem with late import (#428)

- fixes #427
  • Loading branch information...
mrbean-bremen authored and jmcgeheeiv committed Sep 9, 2018
1 parent 2638de2 commit eeb80f63836966e8ba89635091415e296cf2551d
Showing with 15 additions and 0 deletions.
  1. +1 −0 pyfakefs/fake_filesystem_unittest.py
  2. +14 −0 pyfakefs/tests/fake_filesystem_unittest_test.py
@@ -41,6 +41,7 @@
import sys
import tempfile
import unittest
import zipfile # import here to make sure it gets correctly stubbed, see #427
from pyfakefs.deprecator import Deprecator
@@ -378,5 +378,19 @@ def test_set_up_pyfakefs(self):
self.assertIsInstance(self.fs, fake_filesystem.FakeFilesystem)
class TestShutilWithZipfile(fake_filesystem_unittest.TestCase):
"""Regression test for #427."""
def setUp(self):
self.setUpPyfakefs()
self.fs.create_file('foo/bar')
def test_a(self):
shutil.make_archive('archive', 'zip', root_dir='foo')
def test_b(self):
# used to fail because 'bar' could not be found
shutil.make_archive('archive', 'zip', root_dir='foo')
if __name__ == "__main__":
unittest.main()

0 comments on commit eeb80f6

Please sign in to comment.