Permalink
Browse files

tests/unix/extra_coverage: Add tests for importing frozen packages.

  • Loading branch information...
1 parent b528e9a commit a722ed532ff254d1ce657466b7b1aac264433f7e @dpgeorge dpgeorge committed Jan 8, 2017
@@ -17,3 +17,15 @@
# test basic import of frozen scripts
import frzstr1
import frzmpy1
+
+# test import of frozen packages with __init__.py
+import frzstr_pkg1
+print(frzstr_pkg1.x)
+import frzmpy_pkg1
+print(frzmpy_pkg1.x)
+
+# test import of frozen packages without __init__.py
+from frzstr_pkg2.mod import Foo
+print(Foo.x)
+from frzmpy_pkg2.mod import Foo
+print(Foo.x)
@@ -50,3 +50,11 @@ Warning: test
7300
frzstr1
frzmpy1
+frzstr_pkg1.__init__
+1
+frzmpy_pkg1.__init__
+1
+frzstr_pkg2.mod
+1
+frzmpy_pkg2.mod
+1
@@ -0,0 +1,3 @@
+# test frozen package with __init__.py
+print('frzmpy_pkg1.__init__')
+x = 1
@@ -0,0 +1,4 @@
+# test frozen package without __init__.py
+print('frzmpy_pkg2.mod')
+class Foo:
+ x = 1
@@ -0,0 +1,3 @@
+# test frozen package with __init__.py
+print('frzstr_pkg1.__init__')
+x = 1
@@ -0,0 +1,4 @@
+# test frozen package without __init__.py
+print('frzstr_pkg2.mod')
+class Foo:
+ x = 1

0 comments on commit a722ed5

Please sign in to comment.