Skip to content

Commit f98b5d4

Browse files
committed
Remove unnecessary parametrized
1 parent 68cfd13 commit f98b5d4

File tree

1 file changed

+6
-29
lines changed

1 file changed

+6
-29
lines changed

tests/test_warnings.py

+6-29
Original file line numberDiff line numberDiff line change
@@ -51,41 +51,18 @@ def test_warning_double_register_fail():
5151

5252
def test_warning_register():
5353
assert m.CustomWarning is not None
54-
assert issubclass(m.CustomWarning, DeprecationWarning)
5554

5655
with pytest.warns(m.CustomWarning) as excinfo:
5756
warnings.warn("This is warning from Python!", m.CustomWarning, stacklevel=1)
5857

5958
assert issubclass(excinfo[0].category, DeprecationWarning)
60-
assert issubclass(excinfo[0].category, m.CustomWarning)
6159
assert str(excinfo[0].message) == "This is warning from Python!"
6260

6361

64-
@pytest.mark.parametrize(
65-
(
66-
"expected_category",
67-
"expected_base",
68-
"expected_message",
69-
"expected_value",
70-
"module_function",
71-
),
72-
[
73-
(
74-
m.CustomWarning,
75-
DeprecationWarning,
76-
"This is CustomWarning",
77-
37,
78-
m.warn_with_custom_type,
79-
),
80-
],
81-
)
82-
def test_warning_custom(
83-
expected_category, expected_base, expected_message, expected_value, module_function
84-
):
85-
with pytest.warns(expected_category) as excinfo:
86-
value = module_function()
62+
def test_warning_custom():
63+
with pytest.warns(m.CustomWarning) as excinfo:
64+
value = m.warn_with_custom_type()
8765

88-
assert issubclass(excinfo[0].category, expected_base)
89-
assert issubclass(excinfo[0].category, expected_category)
90-
assert str(excinfo[0].message) == expected_message
91-
assert value == expected_value
66+
assert issubclass(excinfo[0].category, DeprecationWarning)
67+
assert str(excinfo[0].message) == "This is CustomWarning"
68+
assert value == 37

0 commit comments

Comments
 (0)