Better names for the test parametrizations

This commit is contained in:
Dave Halter
2017-10-10 19:09:37 +02:00
parent 516189c7e3
commit 5c6531ffae

View File

@@ -24,6 +24,12 @@ class IntegrationTestFile(object):
pytest.fail("{0} failed:\n{1}".format(
self.path, output.decode('utf-8')), pytrace=False)
@property
def name(self):
name = os.path.basename(self.path)
name, _, _ = name.rpartition('.')
return name
def __repr__(self):
return "<%s: %s>" % (type(self), self.path)
@@ -57,4 +63,5 @@ def pytest_generate_tests(metafunc):
if f.endswith('.vim'):
yield IntegrationTestFile(os.path.join(TEST_DIR, f))
metafunc.parametrize('case', list(collect_tests()))
tests = list(collect_tests())
metafunc.parametrize('case', tests, ids=[test.name for test in tests])