|
15 | 15 | from unittest import TestCase |
16 | 16 |
|
17 | 17 | # ## Python Third Party Imports ---- |
18 | | -import pytest |
19 | 18 | from parameterized import parameterized |
| 19 | +from pytest import raises |
20 | 20 |
|
21 | 21 | # ## Local First Party Imports ---- |
22 | 22 | from tests.setup import ( |
@@ -137,7 +137,7 @@ def test_is_value_of_type( |
137 | 137 | assert_type(_val, _typ) |
138 | 138 | assert_value_of_type(_val, _typ) |
139 | 139 | else: |
140 | | - with pytest.raises(TypeError): |
| 140 | + with raises(TypeError): |
141 | 141 | assert_type(_val, _typ) |
142 | 142 | assert_value_of_type(_val, _typ) |
143 | 143 |
|
@@ -187,7 +187,7 @@ def test_is_all_values_of_type( |
187 | 187 | assert_all_values_of_type(_vals, _typ) |
188 | 188 | assert_all_type(_vals, _typ) |
189 | 189 | else: |
190 | | - with pytest.raises(TypeError): |
| 190 | + with raises(TypeError): |
191 | 191 | assert_all_values_of_type(_vals, _typ) |
192 | 192 | assert_all_type(_vals, _typ) |
193 | 193 |
|
@@ -237,7 +237,7 @@ def test_is_any_values_of_type( |
237 | 237 | assert_any_values_of_type(_vals, _typ) |
238 | 238 | assert_any_type(_vals, _typ) |
239 | 239 | else: |
240 | | - with pytest.raises(TypeError): |
| 240 | + with raises(TypeError): |
241 | 241 | assert_any_values_of_type(_vals, _typ) |
242 | 242 | assert_any_type(_vals, _typ) |
243 | 243 |
|
@@ -295,27 +295,27 @@ def test_is_any_values_in_iterable(self, _nam: str, _vals: Any) -> None: |
295 | 295 | assert_any_in(_val, _vals) |
296 | 296 |
|
297 | 297 | def test_raises_assert_value_of_type(self) -> None: |
298 | | - with pytest.raises(TypeError): |
| 298 | + with raises(TypeError): |
299 | 299 | assert_value_of_type(5, str) |
300 | 300 | assert_value_of_type("5", int) |
301 | 301 |
|
302 | 302 | def test_raises_all_values_of_type(self) -> None: |
303 | | - with pytest.raises(TypeError): |
| 303 | + with raises(TypeError): |
304 | 304 | assert_all_values_of_type((1, 2, 3, 4, 5), str) |
305 | 305 | assert_all_values_of_type(("1", "2", "3", "4", "5"), int) |
306 | 306 |
|
307 | 307 | def test_raises_assert_value_in_iterable(self) -> None: |
308 | | - with pytest.raises(LookupError): |
| 308 | + with raises(LookupError): |
309 | 309 | assert_value_in_iterable("a", (1, 2, 3)) |
310 | 310 | assert_value_in_iterable(1, ("a", "b", "c")) |
311 | 311 |
|
312 | 312 | def test_raises_assert_any_values_in_iterable(self) -> None: |
313 | | - with pytest.raises(LookupError): |
| 313 | + with raises(LookupError): |
314 | 314 | assert_any_values_in_iterable(("a", "b"), (1, 2, 3)) |
315 | 315 | assert_any_values_in_iterable((1, 2), ("a", "b", "c")) |
316 | 316 |
|
317 | 317 | def test_raises_assert_all_values_in_iterable(self) -> None: |
318 | | - with pytest.raises(LookupError): |
| 318 | + with raises(LookupError): |
319 | 319 | assert_all_values_in_iterable(("a", "d"), ("a", "b", "c")) |
320 | 320 |
|
321 | 321 |
|
@@ -449,9 +449,9 @@ def test_assert_is_valid(self, _val: Any, _op: str, _targ: Any) -> None: |
449 | 449 | name_func=name_func_flat_list, |
450 | 450 | ) |
451 | 451 | def test_assert_not_is_valid(self, _val: Any, _op: str, _targ: Any) -> None: |
452 | | - with pytest.raises(ValueError): |
| 452 | + with raises(ValueError): |
453 | 453 | assert_is_valid(_val, _op, _targ) |
454 | 454 |
|
455 | 455 | def test_assert_is_valid_unknown_operator(self) -> None: |
456 | | - with pytest.raises(ValueError): |
| 456 | + with raises(ValueError): |
457 | 457 | assert_is_valid(5, "unknown", 10) |
0 commit comments