This commit is contained in:
ST John 2017-11-30 10:19:29 +00:00
parent 5085aa2bce
commit e66473853c
1 changed files with 14 additions and 0 deletions

View File

@ -235,6 +235,20 @@ class TestMetafunc(object):
for val, expected in values:
assert _idval(val, 'a', 6, None) == expected
def test_class_or_function_idval(self):
"""unittest for the expected behavior to obtain ids for parametrized
values that are classes or functions: their __name__.
"""
from _pytest.python import _idval
class TestClass: pass
def test_function(): pass
values = [
(TestClass, "TestClass"),
(test_function, "test_function"),
]
for val, expected in values:
assert _idval(val, 'a', 6, None) == expected
@pytest.mark.issue250
def test_idmaker_autoname(self):
from _pytest.python import idmaker