@@ -24,14 +24,27 @@ def task_warning(produces):
2424Running pytask produces
2525
2626``` {image} /_static/images/warning.svg
27+
2728```
2829
2930## Controlling warnings
3031
31- You can use the ` filterwarnings ` option in ` pyproject.toml ` to configure pytasks
32- behavior to warnings. For example, the configuration below will ignore all user warnings
33- and specific deprecation warnings matching a regex, but will transform all other
34- warnings into errors.
32+ You can use the ` filterwarnings ` option in ` pyproject.toml ` to configure pytask's
33+ behavior when it comes to warnings.
34+
35+ The syntax for specifying warnings filters is the same as in the
36+ [ Python standard library] ( https://docs.python.org/3/library/warnings.html#the-warnings-filter ) ,
37+ i.e., a sequence of fields separated by colons:
38+
39+ ```
40+ action:message:category:module:line
41+ ```
42+
43+ You can specify a list of such filters. When a warning matches more than one option, the
44+ action for the last matching option is performed.
45+
46+ For example, the configuration below will ignore specific deprecation warnings matching
47+ a regex, all user warnings, and transform all other warnings into errors.
3548
3649``` toml
3750[tool .pytask .ini_options ]
@@ -43,8 +56,10 @@ filterwarnings = [
4356]
4457```
4558
46- When a warning matches more than one option in the list, the action for the last
47- matching option is performed.
59+ The syntax is explained in more detail in
60+ [ this section] ( https://docs.python.org/3/library/warnings.html#the-warnings-filter ) of
61+ the Python documentation and there are also
62+ [ more examples] ( https://docs.python.org/3/library/warnings.html#describing-warning-filters ) .
4863
4964## ` @pytask.mark.filterwarnings `
5065
0 commit comments