Make it possible to use certain python versions according to the file name of a normalizer issue file.

This commit is contained in:
Dave Halter
2017-07-10 23:50:17 +02:00
parent 65203d197a
commit 679851dbf1
2 changed files with 9 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
import re
import tempfile
import shutil
import logging
@@ -36,12 +37,12 @@ def pytest_addoption(parser):
def pytest_generate_tests(metafunc):
if 'normalizer_issue_file' in metafunc.fixturenames:
if 'normalizer_issue_case' in metafunc.fixturenames:
base_dir = os.path.join(os.path.dirname(__file__), 'test', 'normalizer_issue_files')
cases = list(colllect_normalizer_tests(base_dir))
metafunc.parametrize(
'normalizer_issue_file',
'normalizer_issue_case',
cases,
ids=[c.name for c in cases]
)
@@ -55,6 +56,8 @@ class NormalizerIssueCase(object):
def __init__(self, path):
self.path = path
self.name = os.path.basename(path)
match = re.search(r'python([\d.]+)\.py', self.name)
self.python_version = match and match.group(1)
def colllect_normalizer_tests(base_dir):