|
7 | 7 | import itertools |
8 | 8 | import pickle |
9 | 9 | import unittest |
10 | | -from annotationlib import Format, ForwardRef, get_annotations, get_annotate_function, annotations_to_source, value_to_source |
| 10 | +from annotationlib import ( |
| 11 | + Format, |
| 12 | + ForwardRef, |
| 13 | + get_annotations, |
| 14 | + get_annotate_function, |
| 15 | + annotations_to_source, |
| 16 | + value_to_source, |
| 17 | +) |
11 | 18 | from typing import Unpack |
12 | 19 |
|
13 | 20 | from test import support |
@@ -329,7 +336,10 @@ def test_name_lookup_without_eval(self): |
329 | 336 | # namespaces without going through eval() |
330 | 337 | self.assertIs(ForwardRef("int").evaluate(), int) |
331 | 338 | self.assertIs(ForwardRef("int").evaluate(locals={"int": str}), str) |
332 | | - self.assertIs(ForwardRef("int").evaluate(locals={"int": float}, globals={"int": str}), float) |
| 339 | + self.assertIs( |
| 340 | + ForwardRef("int").evaluate(locals={"int": float}, globals={"int": str}), |
| 341 | + float, |
| 342 | + ) |
333 | 343 | self.assertIs(ForwardRef("int").evaluate(globals={"int": str}), str) |
334 | 344 | with support.swap_attr(builtins, "int", dict): |
335 | 345 | self.assertIs(ForwardRef("int").evaluate(), dict) |
@@ -1100,11 +1110,11 @@ def test_annotations_to_source(self): |
1100 | 1110 | self.assertEqual(annotations_to_source({}), {}) |
1101 | 1111 | self.assertEqual(annotations_to_source({"x": int}), {"x": "int"}) |
1102 | 1112 | self.assertEqual(annotations_to_source({"x": "int"}), {"x": "int"}) |
1103 | | - self.assertEqual(annotations_to_source({"x": int, "y": str}), {"x": "int", "y": "str"}) |
| 1113 | + self.assertEqual( |
| 1114 | + annotations_to_source({"x": int, "y": str}), {"x": "int", "y": "str"} |
| 1115 | + ) |
1104 | 1116 |
|
1105 | 1117 |
|
1106 | 1118 | class TestAnnotationLib(unittest.TestCase): |
1107 | 1119 | def test__all__(self): |
1108 | 1120 | support.check__all__(self, annotationlib) |
1109 | | - |
1110 | | - |
|
0 commit comments