Only skip null bytes before setting the environment variable
As discussed, node ids have already been "ascii" sanitized by the parametrization process
This commit is contained in:
parent
1deac2e210
commit
7703dc921c
|
@ -7,7 +7,7 @@ import sys
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
import py
|
import py
|
||||||
from _pytest.compat import _ascii_escaped, _PY2
|
from _pytest.compat import _PY2
|
||||||
from _pytest._code.code import TerminalRepr, ExceptionInfo
|
from _pytest._code.code import TerminalRepr, ExceptionInfo
|
||||||
from _pytest.outcomes import skip, Skipped, TEST_OUTCOME
|
from _pytest.outcomes import skip, Skipped, TEST_OUTCOME
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ def _update_current_test_var(item, when):
|
||||||
"""
|
"""
|
||||||
var_name = 'PYTEST_CURRENT_TEST'
|
var_name = 'PYTEST_CURRENT_TEST'
|
||||||
if when:
|
if when:
|
||||||
value = _ascii_escaped('{0} ({1})'.format(item.nodeid, when))
|
value = '{0} ({1})'.format(item.nodeid, when)
|
||||||
if _PY2:
|
if _PY2:
|
||||||
# python 2 doesn't like null bytes on environment variables (see #2644)
|
# python 2 doesn't like null bytes on environment variables (see #2644)
|
||||||
value = value.replace('\x00', '(null)')
|
value = value.replace('\x00', '(null)')
|
||||||
|
|
Loading…
Reference in New Issue