You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/changelog.rst
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,10 @@ Version History
17
17
18
18
* Thanks to `@gnikonorov <https://github.com/gnikonorov>`_ for the PR
19
19
20
+
* Implement :code:`environment_table_redact_list` to allow for redaction of environment table values. (`#233 <https://github.com/pytest-dev/pytest-html/issues/233>`_)
21
+
22
+
* Thanks to `@fenchu <https://github.com/fenchu>`_ for reporting and `@gnikonorov <https://github.com/gnikonorov>`_ for the PR
Copy file name to clipboardExpand all lines: docs/user_guide.rst
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,8 +80,20 @@ Note that in the above example `@pytest.hookimpl(tryfirst=True)`_ is important,
80
80
If this line is omitted, then the *Environment* table will **not** be updated since the :code:`pytest_sessionfinish` of the plugins will execute first,
81
81
and thus not pick up your change.
82
82
83
-
The generated table will be sorted alphabetically unless the metadata is a
84
-
:code:`collections.OrderedDict`.
83
+
The generated table will be sorted alphabetically unless the metadata is a :code:`collections.OrderedDict`.
84
+
85
+
It is possible to redact variables from the environment table. Redacted variables will have their names displayed, but their values grayed out.
86
+
This can be achieved by setting :code:`environment_table_redact_list` in your INI configuration file (e.g.: :code:`pytest.ini`).
87
+
:code:`environment_table_redact_list` is a :code:`linelist` of regexes. Any environment table variable that matches a regex in this list has its value redacted.
88
+
89
+
For example, the following will redact all environment table variables that match the regexes :code:`^foo$`, :code:`.*redact.*`, or :code:`bar`:
0 commit comments