Skip to content

Commit

Permalink
Only skip null bytes before setting the environment variable
Browse files Browse the repository at this point in the history
As discussed, node ids have already been "ascii" sanitized by the
parametrization process
  • Loading branch information
nicoddemus authored and fgmacedo committed Sep 4, 2017
1 parent ecc2cf6 commit c283e80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _pytest/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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

Expand Down Expand Up @@ -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)')
Expand Down

0 comments on commit c283e80

Please sign in to comment.