Skip to content

Commit ade3152

Browse files
committed
Use typing.Union
1 parent 19deb1c commit ade3152

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

stdlib/@tests/test_cases/check_unittest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from datetime import datetime, timedelta
66
from decimal import Decimal
77
from fractions import Fraction
8-
from typing import TypedDict
8+
from typing import TypedDict, Union
99
from typing_extensions import assert_type
1010
from unittest.mock import AsyncMock, MagicMock, Mock, patch
1111

@@ -181,7 +181,7 @@ def method() -> int:
181181

182182

183183
with patch("sys.exit") as default_new_enter:
184-
assert_type(default_new_enter, MagicMock | AsyncMock)
184+
assert_type(default_new_enter, Union[MagicMock, AsyncMock])
185185

186186
with patch("sys.exit", new=42) as explicit_new_enter:
187187
assert_type(explicit_new_enter, int)
@@ -219,7 +219,7 @@ def obj_f_explicit_new_callable(i: int, new_callable_ret: int) -> str:
219219

220220

221221
with patch.object(Decimal, "exp") as obj_default_new_enter:
222-
assert_type(obj_default_new_enter, MagicMock | AsyncMock)
222+
assert_type(obj_default_new_enter, Union[MagicMock, AsyncMock])
223223

224224
with patch.object(Decimal, "exp", new=42) as obj_explicit_new_enter:
225225
assert_type(obj_explicit_new_enter, int)

0 commit comments

Comments
 (0)