Remove unused/unneeded code

This commit is contained in:
Bruno Oliveira 2019-06-15 10:16:59 -03:00
parent 355eb5adfb
commit 177af032d2
3 changed files with 1 additions and 17 deletions

View File

@ -1170,8 +1170,6 @@ def _idval(val, argname, idx, idfn, item, config):
# See issue https://github.com/pytest-dev/pytest/issues/2169
msg = "{}: error raised while trying to determine id of parameter '{}' at position {}\n"
msg = msg.format(item.nodeid, argname, idx)
# we only append the exception type and message because on Python 2 reraise does nothing
msg += " {}: {}\n".format(type(e).__name__, e)
raise ValueError(msg) from e
elif config:
hook_id = config.hook.pytest_make_parametrize_id(

View File

@ -20,20 +20,6 @@ from _pytest.outcomes import fail
BASE_TYPE = (type, STRING_TYPES)
def _cmp_raises_type_error(self, other):
"""__cmp__ implementation which raises TypeError. Used
by Approx base classes to implement only == and != and raise a
TypeError for other comparisons.
Needed in Python 2 only, Python 3 all it takes is not implementing the
other operators at all.
"""
__tracebackhide__ = True
raise TypeError(
"Comparison operators other than == and != not supported by approx objects"
)
def _non_numeric_type_error(value, at):
at_str = " at {}".format(at) if at else ""
return TypeError(

View File

@ -506,8 +506,8 @@ class TestMetafunc:
result = testdir.runpytest()
result.stdout.fnmatch_lines(
[
"*test_foo: error raised while trying to determine id of parameter 'arg' at position 0",
"*Exception: bad ids",
"*test_foo: error raised while trying to determine id of parameter 'arg' at position 0",
]
)