Skip to content

Commit c1b5ef9

Browse files
author
Muhamed Fazal PS
committed
fix: replace bare except with except Exception in test files
1 parent dbc61cb commit c1b5ef9

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

ropetest/contrib/codeassisttest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ def test_and_normal_complete_blocks_and_single_fixing(self):
924924
code = dedent("""\
925925
try:
926926
range.
927-
except:
927+
except Exception:
928928
pass
929929
""")
930930
result = self._assist(code, code.index("."), maxfixes=1) # noqa

ropetest/pycoretest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def test_variables_defined_in_excepts(self):
546546
code = dedent("""\
547547
try:
548548
myvar1 = 1
549-
except:
549+
except Exception:
550550
myvar2 = 1
551551
finally:
552552
myvar3 = 1

ropetest/refactor/patchedasttest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ def test_try_except_and_finally_node(self):
11431143
source = dedent("""\
11441144
try:
11451145
pass
1146-
except:
1146+
except Exception:
11471147
pass
11481148
finally:
11491149
pass

ropetest/refactor/similarfindertest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ def test_matching_nested_try_finally(self):
167167
if 1:
168168
try:
169169
pass
170-
except:
170+
except Exception:
171171
pass
172172
""")
173173
pattern = dedent("""\
174174
try:
175175
pass
176-
except:
176+
except Exception:
177177
pass
178178
""")
179179
finder = self._create_finder(source)

ropetest/refactor/suitestest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_try_except(self):
7575
root = source_suite_tree(dedent("""\
7676
try:
7777
pass
78-
except:
78+
except Exception:
7979
pass
8080
else:
8181
pass
@@ -87,7 +87,7 @@ def test_try_except_finally(self):
8787
root = source_suite_tree(dedent("""\
8888
try:
8989
pass
90-
except:
90+
except Exception:
9191
pass
9292
finally:
9393
pass

0 commit comments

Comments
 (0)