File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -248,8 +248,10 @@ but literal strings in the latter two.
248248 # Ignore warnings in "yourmodule.submodule" which contain "generic".
249249 # Note that the '.' in 'message' marks any character and in 'module' it is escaped,
250250 # in order to match a literal dot character.
251+
251252 filterwarnings("ignore", message="generic", module=r"yourmodule\.submodule")
252253 # Ignore warnings in "yourmodule.submodule" which START with "generic".
254+
253255 filterwarnings("ignore", module="yourmodule.*")
254256 # Ignore all warnings in "yourmodule" and its submodules.
255257 # Note that the '.' in 'module' marks any character so is not escaped.
@@ -259,6 +261,7 @@ but literal strings in the latter two.
259261 # (but not those containing it).
260262 # Also note that the '.' in the module part does not need to be escaped
261263 # since it is not a regular expression.
264+
262265 -W "ignore:::yourmodule:"
263266 # Ignore all warnings in "yourmodule", but NOT in its submodules.
264267
Original file line number Diff line number Diff line change @@ -1366,7 +1366,7 @@ def test_single_warning(self):
13661366
13671367 def test_string_literals (self ):
13681368 # Ensure message/module are treated as string literals
1369- rc , stdout , stderr = assert_python_ok ("-c" ,
1369+ _ , stdout , stderr = assert_python_ok ("-c" ,
13701370 "import sys, warnings; "
13711371 "sys.stdout.write(warnings.filters[0][1].pattern); "
13721372 "sys.stderr.write(warnings.filters[0][3].pattern)" ,
You can’t perform that action at this time.
0 commit comments