Skip to content

Commit 6b98f24

Browse files
committed
Remove useless type comparison in tests
1 parent 143bff0 commit 6b98f24

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

tests/test_main.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,13 @@ def test_main_no_scripts() -> None:
4242
with pytest.raises(SystemExit) as exc:
4343
with mock.patch.object(sys, "argv", args):
4444
weechat_script_lint.main()
45-
assert exc.type == SystemExit
4645
assert exc.value.code == 2
4746

4847
# display help
4948
args = ["weechat-script-lint", "--help"]
5049
with pytest.raises(SystemExit) as exc:
5150
with mock.patch.object(sys, "argv", args):
5251
weechat_script_lint.main()
53-
assert exc.type == SystemExit
5452
assert exc.value.code == 0
5553

5654

@@ -63,7 +61,6 @@ def test_main_script() -> None:
6361
with pytest.raises(SystemExit) as exc:
6462
with mock.patch.object(sys, "argv", args):
6563
weechat_script_lint.main()
66-
assert exc.type == SystemExit
6764
assert "FATAL" in exc.value.code # type: ignore
6865

6966
# check script OK
@@ -72,7 +69,6 @@ def test_main_script() -> None:
7269
with pytest.raises(SystemExit) as exc:
7370
with mock.patch.object(sys, "argv", args):
7471
weechat_script_lint.main()
75-
assert exc.type == SystemExit
7672
assert exc.value.code == 0
7773

7874

@@ -89,7 +85,6 @@ def test_main_dir() -> None:
8985
with pytest.raises(SystemExit) as exc:
9086
with mock.patch.object(sys, "argv", args):
9187
weechat_script_lint.main()
92-
assert exc.type == SystemExit
9388
assert exc.value.code == 10
9489

9590
# check directory with scripts, treat warnings as errors
@@ -103,7 +98,6 @@ def test_main_dir() -> None:
10398
with pytest.raises(SystemExit) as exc:
10499
with mock.patch.object(sys, "argv", args):
105100
weechat_script_lint.main()
106-
assert exc.type == SystemExit
107101
assert exc.value.code == 26
108102

109103
# check directory with scripts, display scripts by score
@@ -117,7 +111,6 @@ def test_main_dir() -> None:
117111
with pytest.raises(SystemExit) as exc:
118112
with mock.patch.object(sys, "argv", args):
119113
weechat_script_lint.main()
120-
assert exc.type == SystemExit
121114
assert exc.value.code == 10
122115

123116
args = [
@@ -131,7 +124,6 @@ def test_main_dir() -> None:
131124
with pytest.raises(SystemExit) as exc:
132125
with mock.patch.object(sys, "argv", args):
133126
weechat_script_lint.main()
134-
assert exc.type == SystemExit
135127
assert exc.value.code == 9
136128

137129
# check a script returning only a warning
@@ -144,7 +136,6 @@ def test_main_dir() -> None:
144136
with pytest.raises(SystemExit) as exc:
145137
with mock.patch.object(sys, "argv", args):
146138
weechat_script_lint.main()
147-
assert exc.type == SystemExit
148139
assert exc.value.code == 0
149140

150141
# check a script returning only an info
@@ -157,7 +148,6 @@ def test_main_dir() -> None:
157148
with pytest.raises(SystemExit) as exc:
158149
with mock.patch.object(sys, "argv", args):
159150
weechat_script_lint.main()
160-
assert exc.type == SystemExit
161151
assert exc.value.code == 0
162152

163153
# check a file that isn't a WeeChat script
@@ -166,7 +156,6 @@ def test_main_dir() -> None:
166156
with pytest.raises(SystemExit) as exc:
167157
with mock.patch.object(sys, "argv", args):
168158
weechat_script_lint.main()
169-
assert exc.type == SystemExit
170159
assert exc.value.code == 0
171160

172161

@@ -181,5 +170,4 @@ def test_init() -> None:
181170
):
182171
with mock.patch.object(sys, "argv", args):
183172
weechat_script_lint.init(force=True)
184-
assert exc.type == SystemExit
185173
assert exc.value.code == 0

0 commit comments

Comments
 (0)