File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 88from logging import warning
99from traceback import extract_stack
1010
11+
1112def remapparams (** remap ):
1213 '''
1314 Remap the specified named parameters.
@@ -65,7 +66,7 @@ def remapparams_wrapper(*a, **kw):
6566 def parser (s , parse_all = True ):
6667 pass
6768
68- assert parser .__name__ == 'parser'
69+ assert parser .__name__ == 'parser' # noqa: S101
6970 parser ('foo' )
7071 # this should not warn
7172 parser ('foo' , parse_all = False )
@@ -77,7 +78,9 @@ def parser(s, parse_all=True):
7778 except ValueError :
7879 pass
7980 else :
80- assert False , "expected ValueError because of duplicated parameters"
81+ raise AssertionError (
82+ "expected ValueError because of duplicated parameters"
83+ )
8184
8285 try :
8386 @remapparams ()
@@ -86,12 +89,16 @@ def no_remappings():
8689 except ValueError :
8790 pass
8891 else :
89- assert False , "expected ValueError from @remapparams() because no remappings"
92+ raise AssertionError (
93+ "expected ValueError from @remapparams() because no remappings"
94+ )
9095 try :
9196 @remapparams (p1 = 'p2' , p2 = 'p3' )
9297 def no_remappings ():
9398 pass
9499 except ValueError :
95100 pass
96101 else :
97- assert False , "expected ValueError from @remapparams() because p1 remaps to another remapped parameter"
102+ raise AssertionError (
103+ "expected ValueError from @remapparams() because p1 remaps to another remapped parameter"
104+ )
You can’t perform that action at this time.
0 commit comments