Skip to content

Commit

Permalink
pythongh-104415: Fix refleak tests for typing.ByteString deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed May 12, 2023
1 parent f0f5bb3 commit e8f6c3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6004,16 +6004,17 @@ def test_mutablesequence(self):
self.assertNotIsInstance((), typing.MutableSequence)

def test_bytestring(self):
_typing = import_fresh_module('typing')
with self.assertWarns(DeprecationWarning):
from typing import ByteString
ByteString = _typing.ByteString
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(b'', ByteString)
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(bytearray(b''), ByteString)
with self.assertWarns(DeprecationWarning):
class Foo(ByteString): ...
with self.assertWarns(DeprecationWarning):
class Bar(ByteString, typing.Awaitable): ...
class Bar(ByteString, _typing.Awaitable): ...

def test_list(self):
self.assertIsSubclass(list, typing.List)
Expand Down

0 comments on commit e8f6c3d

Please sign in to comment.