[Python-checkins] Trivial improvements to dataclasses tests. (GH-6234)

Miss Islington (bot) webhook-mailer at python.org
Sun Mar 25 09:27:53 EDT 2018


https://github.com/python/cpython/commit/5666a55da89491bae717e67ad098ac31e310a8e1
commit: 5666a55da89491bae717e67ad098ac31e310a8e1
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-03-25T06:27:50-07:00
summary:

Trivial improvements to dataclasses tests. (GH-6234)

(cherry picked from commit 51c9ab42ab84643081d75c83a586afa45d910383)

Co-authored-by: Eric V. Smith <ericvsmith at users.noreply.github.com>

files:
M Lib/test/test_dataclasses.py

diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py
index 75e3cffc4a5e..df53b040c0e1 100755
--- a/Lib/test/test_dataclasses.py
+++ b/Lib/test/test_dataclasses.py
@@ -805,6 +805,7 @@ def bar(self) -> int:
         self.assertEqual(list(C.__annotations__), ['i'])
         self.assertEqual(C(10).foo(), 4)
         self.assertEqual(C(10).bar, 5)
+        self.assertEqual(C(10).i, 10)
 
     def test_post_init(self):
         # Just make sure it gets called
@@ -1488,7 +1489,7 @@ def nt(lst):
         self.assertIs(type(t), NT)
 
     def test_dynamic_class_creation(self):
-        cls_dict = {'__annotations__': OrderedDict(x=int, y=int),
+        cls_dict = {'__annotations__': {'x':int, 'y':int},
                     }
 
         # Create the class.
@@ -1501,7 +1502,7 @@ def test_dynamic_class_creation(self):
         self.assertEqual(asdict(cls(1, 2)), {'x': 1, 'y': 2})
 
     def test_dynamic_class_creation_using_field(self):
-        cls_dict = {'__annotations__': OrderedDict(x=int, y=int),
+        cls_dict = {'__annotations__': {'x':int, 'y':int},
                     'y': field(default=5),
                     }
 



More information about the Python-checkins mailing list