From 7703dc921ccdafb65cd32bc4b9ec4d266e2538da Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 2 Aug 2017 10:27:45 -0300 Subject: [PATCH] Only skip null bytes before setting the environment variable As discussed, node ids have already been "ascii" sanitized by the parametrization process --- _pytest/runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_pytest/runner.py b/_pytest/runner.py index d200d1052..ed58aceec 100644 --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -7,7 +7,7 @@ import sys from time import time import py -from _pytest.compat import _ascii_escaped, _PY2 +from _pytest.compat import _PY2 from _pytest._code.code import TerminalRepr, ExceptionInfo from _pytest.outcomes import skip, Skipped, TEST_OUTCOME @@ -135,7 +135,7 @@ def _update_current_test_var(item, when): """ var_name = 'PYTEST_CURRENT_TEST' if when: - value = _ascii_escaped('{0} ({1})'.format(item.nodeid, when)) + value = '{0} ({1})'.format(item.nodeid, when) if _PY2: # python 2 doesn't like null bytes on environment variables (see #2644) value = value.replace('\x00', '(null)')