Add originalname attribute to Function

Related to #1790
This commit is contained in:
Bruno Oliveira
2016-08-03 22:56:12 -03:00
parent 530b0050b4
commit 1a79137d04
2 changed files with 20 additions and 3 deletions

View File

@@ -634,6 +634,15 @@ class TestFunction:
result = testdir.runpytest()
result.stdout.fnmatch_lines('* 3 passed in *')
def test_function_original_name(self, testdir):
items = testdir.getitems("""
import pytest
@pytest.mark.parametrize('arg', [1,2])
def test_func(arg):
pass
""")
assert [x.originalname for x in items] == ['test_func', 'test_func']
class TestSorting:
def test_check_equality(self, testdir):