diff --git a/setup.cfg b/setup.cfg index e053fef..945e0fa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,3 +5,7 @@ formats=bztar source-dir = rst build-dir = doc +[tool:pytest] +markers = + no_ssl + diff --git a/test/test_dugong.py b/test/test_dugong.py index ef1409e..6f731e8 100755 --- a/test/test_dugong.py +++ b/test/test_dugong.py @@ -83,10 +83,17 @@ def pytest_generate_tests(metafunc): if not 'http_server' in metafunc.fixturenames: return - if getattr(metafunc.function, 'no_ssl', False): - params = ('plain',) + if hasattr(metafunc, 'definition'): + if metafunc.definition.get_closest_marker('no_ssl'): + params = ('plain',) + else: + params = ('plain', 'ssl') else: - params = ('plain', 'ssl') + # pytest < 3.6 + if getattr(metafunc.function, 'no_ssl', False): + params = ('plain',) + else: + params = ('plain', 'ssl') metafunc.parametrize("http_server", params, indirect=True, scope='module')