Skip to content

Commit e8f6c3d

Browse files
committed
gh-104415: Fix refleak tests for typing.ByteString deprecation
1 parent f0f5bb3 commit e8f6c3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_typing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6004,16 +6004,17 @@ def test_mutablesequence(self):
60046004
self.assertNotIsInstance((), typing.MutableSequence)
60056005

60066006
def test_bytestring(self):
6007+
_typing = import_fresh_module('typing')
60076008
with self.assertWarns(DeprecationWarning):
6008-
from typing import ByteString
6009+
ByteString = _typing.ByteString
60096010
with self.assertWarns(DeprecationWarning):
60106011
self.assertIsInstance(b'', ByteString)
60116012
with self.assertWarns(DeprecationWarning):
60126013
self.assertIsInstance(bytearray(b''), ByteString)
60136014
with self.assertWarns(DeprecationWarning):
60146015
class Foo(ByteString): ...
60156016
with self.assertWarns(DeprecationWarning):
6016-
class Bar(ByteString, typing.Awaitable): ...
6017+
class Bar(ByteString, _typing.Awaitable): ...
60176018

60186019
def test_list(self):
60196020
self.assertIsSubclass(list, typing.List)

0 commit comments

Comments
 (0)