aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_extern.py
diff options
context:
space:
mode:
authorDan Rose <dan@digilabs.io>2019-10-27 02:31:59 -0500
committerDan Rose <dan@digilabs.io>2019-10-27 02:59:55 -0500
commit2d25ca89318922e63b74c37e36d099173cf0da5a (patch)
tree4f96a50932b122eade8fcee76197b82de6e56858 /setuptools/tests/test_extern.py
parent297f2adceda3af402fc08311e42505c8cdc9c54b (diff)
downloadexternal_python_setuptools-2d25ca89318922e63b74c37e36d099173cf0da5a.tar.gz
external_python_setuptools-2d25ca89318922e63b74c37e36d099173cf0da5a.tar.bz2
external_python_setuptools-2d25ca89318922e63b74c37e36d099173cf0da5a.zip
Remove sys.modules hack
Fix #1888 (metadata accidentally not picklable), and removes a case where reimporting a vendored module results in a second copy of the same module.
Diffstat (limited to 'setuptools/tests/test_extern.py')
-rw-r--r--setuptools/tests/test_extern.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/setuptools/tests/test_extern.py b/setuptools/tests/test_extern.py
new file mode 100644
index 00000000..3519a680
--- /dev/null
+++ b/setuptools/tests/test_extern.py
@@ -0,0 +1,22 @@
+import importlib
+import pickle
+
+from setuptools import Distribution
+from setuptools.extern import ordered_set
+from setuptools.tests import py3_only
+
+
+def test_reimport_extern():
+ ordered_set2 = importlib.import_module(ordered_set.__name__)
+ assert ordered_set is ordered_set2
+
+
+def test_orderedset_pickle_roundtrip():
+ o1 = ordered_set.OrderedSet([1, 2, 5])
+ o2 = pickle.loads(pickle.dumps(o1))
+ assert o1 == o2
+
+
+@py3_only
+def test_distribution_picklable():
+ pickle.loads(pickle.dumps(Distribution()))