|
1 | 1 | """Tests for the annotations module.""" |
2 | 2 |
|
| 3 | +import textwrap |
| 4 | +import annotationlib |
3 | 5 | import builtins |
4 | 6 | import collections |
5 | 7 | import functools |
6 | 8 | import itertools |
7 | 9 | import pickle |
8 | | -import textwrap |
| 10 | +from string.templatelib import Template |
9 | 11 | import typing |
10 | 12 | import unittest |
11 | | -from string.templatelib import Template |
| 13 | +from annotationlib import ( |
| 14 | + Format, |
| 15 | + ForwardRef, |
| 16 | + get_annotations, |
| 17 | + annotations_to_string, |
| 18 | + type_repr, |
| 19 | +) |
| 20 | +from typing import Unpack, get_type_hints, List, Union |
| 21 | + |
12 | 22 | from test import support |
13 | 23 | from test.support import import_helper |
14 | | -from test.test_inspect import (inspect_stock_annotations, |
15 | | - inspect_stringized_annotations, |
16 | | - inspect_stringized_annotations_2, |
17 | | - inspect_stringized_annotations_pep695) |
18 | | -from typing import List, Union, Unpack, get_type_hints |
19 | | - |
20 | | -import annotationlib |
21 | | -from annotationlib import (Format, ForwardRef, annotations_to_string, |
22 | | - get_annotations, type_repr) |
| 24 | +from test.test_inspect import inspect_stock_annotations |
| 25 | +from test.test_inspect import inspect_stringized_annotations |
| 26 | +from test.test_inspect import inspect_stringized_annotations_2 |
| 27 | +from test.test_inspect import inspect_stringized_annotations_pep695 |
23 | 28 |
|
24 | 29 |
|
25 | 30 | def times_three(fn): |
@@ -1700,7 +1705,6 @@ class C: |
1700 | 1705 | self.assertIs(evaluated.evaluate(), str) |
1701 | 1706 |
|
1702 | 1707 |
|
1703 | | - |
1704 | 1708 | class TestAnnotationLib(unittest.TestCase): |
1705 | 1709 | def test__all__(self): |
1706 | 1710 | support.check__all__(self, annotationlib) |
|
0 commit comments