diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 19863dd83..7668c3a94 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -37,7 +37,6 @@ if _PY3: else: from funcsigs import signature, Parameter as Parameter -NoneType = type(None) NOTSET = object() PY35 = sys.version_info[:2] >= (3, 5) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 035369a59..961a3af5d 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -31,7 +31,6 @@ from _pytest.compat import getlocation from _pytest.compat import is_generator from _pytest.compat import isclass from _pytest.compat import isfunction -from _pytest.compat import NoneType from _pytest.compat import NOTSET from _pytest.compat import REGEX_TYPE from _pytest.compat import safe_getattr @@ -1192,7 +1191,7 @@ def _idval(val, argname, idx, idfn, item, config): if isinstance(val, STRING_TYPES): return _ascii_escaped_by_config(val, config) - elif isinstance(val, (float, int, bool, NoneType)): + elif val is None or isinstance(val, (float, int, bool)): return str(val) elif isinstance(val, REGEX_TYPE): return ascii_escaped(val.pattern)