Skip to content

Commit

Permalink
Move test to ParamSpecTests
Browse files Browse the repository at this point in the history
  • Loading branch information
posita committed Mar 10, 2022
1 parent ad0431d commit 6db57f5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2802,14 +2802,6 @@ def __init__(self, attr: T) -> None:
self.assertEqual(deepcopy(ci).attr, 1)
self.assertEqual(ci.__orig_class__, C[int])

def test_parameter_propagation(self):
# bpo-46581
P = ParamSpec('P')
original = Callable[P, int]
self.assertEqual(original.__parameters__, (P,))
copied = original[P]
self.assertEqual(original.__parameters__, copied.__parameters__)

def test_weakref_all(self):
T = TypeVar('T')
things = [Any, Union[T, int], Callable[..., T], Tuple[Any, Any],
Expand Down Expand Up @@ -5801,6 +5793,14 @@ def test_paramspec_in_nested_generics(self):
self.assertEqual(G2[[int, str], float], list[C])
self.assertEqual(G3[[int, str], float], list[C] | int)

def test_paramspec_gets_copied(self):
# bpo-46581
P = ParamSpec('P')
original = Callable[P, int]
self.assertEqual(original.__parameters__, (P,))
copied = original[P]
self.assertEqual(original.__parameters__, copied.__parameters__)


class ConcatenateTests(BaseTestCase):
def test_basics(self):
Expand Down

0 comments on commit 6db57f5

Please sign in to comment.