Skip to content

Commit 53fcdd2

Browse files
committed
add ini option to disable string escape for parametrization
1 parent d432553 commit 53fcdd2

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Victor Uriarte
174174
Vidar T. Fauske
175175
Vitaly Lashmanov
176176
Vlad Dragos
177+
Volodymyr Piskun
177178
Wouter van Ackooy
178179
Xuan Luong
179180
Xuecong Liao

_pytest/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def pytest_addoption(parser):
8484
"method discovery")
8585
parser.addini("disable_test_id_escaping_and_forfeit_all_rights_to_community_support", type="bool",
8686
default=False, help="disable string escape non-ascii"
87-
" characters, might cause unwanted side effects")
87+
" characters, might cause unwanted side effects(use at your own risk)")
8888

8989
group.addoption("--import-mode", default="prepend",
9090
choices=["prepend", "append"], dest="importmode",

changelog/2482.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Include new ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option to disable ascii-escaping in parametrized values. This may cause a series of problems and as the name makes clear, use at your own risk.

doc/en/parametrize.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ them in turn::
8383

8484
pytest by default escapes any non-ascii characters used in unicode strings
8585
for the parametrization because it has several downsides.
86-
If however you would like to use them, use the option disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True
86+
If however you would like to use unicode strings in parametrization, use this option in your ``pytest.ini``:
87+
88+
.. code-block:: ini
89+
90+
[pytest]
91+
disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True
92+
8793
to disable this behavior, but keep in mind that this might cause unwanted side effects and
8894
even bugs depending on the OS used and plugins currently installed, so use it at your own risk.
8995

0 commit comments

Comments
 (0)