summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_typing.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index ae138c6598..6ddaba94d5 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -1163,6 +1163,14 @@ class NamedTupleTests(TestCase):
assert Emp._fields == ('name', 'id')
assert Emp._field_types == dict(name=str, id=int)
+ def test_pickle(self):
+ global Emp # pickle wants to reference the class by name
+ Emp = NamedTuple('Emp', [('name', str), ('id', int)])
+ jane = Emp('jane', 37)
+ z = pickle.dumps(jane)
+ jane2 = pickle.loads(z)
+ assert jane == jane2
+
class IOTests(TestCase):