Skip to content

Commit 84d3af6

Browse files
committed
Use arguments from subtests parametrization!
1 parent bc1cbcf commit 84d3af6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/test/test_typing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4506,21 +4506,21 @@ class Concrete3(InheritedRCProto3):
45064506

45074507
for inherited_runtime_proto in InheritedRCProto1, InheritedRCProto2, InheritedRCProto3:
45084508
with self.assertWarnsRegex(DeprecationWarning, depr_message_re):
4509-
isinstance(object(), inherited_runtime_proto)
4509+
check_func(check_obj, inherited_runtime_proto)
45104510

45114511
# Don't warn for explicitly checkable protocols and concrete implementations.
45124512
with warnings.catch_warnings():
45134513
warnings.simplefilter("error", DeprecationWarning)
45144514

4515-
for explicit_runtime_proto in RCProto1, RCProto2, RCProto3, Concrete1, Concrete2, Concrete3:
4516-
isinstance(object(), explicit_runtime_proto)
4515+
for checkable in RCProto1, RCProto2, RCProto3, Concrete1, Concrete2, Concrete3:
4516+
check_func(check_obj, checkable)
45174517

45184518
# Don't warn for uncheckable protocols.
45194519
with warnings.catch_warnings():
45204520
warnings.simplefilter("error", DeprecationWarning)
45214521

45224522
with self.assertRaises(TypeError): # Self-test. Protocol below can't be runtime-checkable.
4523-
isinstance(object(), BareProto)
4523+
check_func(check_obj, BareProto)
45244524

45254525
def test_super_call_init(self):
45264526
class P(Protocol):

0 commit comments

Comments
 (0)