correct testing and usage of the empty_parameter_set_mark config option

This commit is contained in:
Ronny Pfannschmidt 2018-01-26 12:05:52 +01:00
parent 77de45cce3
commit a54cd4c2fd
2 changed files with 4 additions and 4 deletions

View File

@ -293,7 +293,7 @@ def pytest_configure(config):
if config.option.strict:
MARK_GEN._config = config
empty_parameterset = config.getini("empty_parameterset")
empty_parameterset = config.getini("empty_parameter_set_mark")
if empty_parameterset not in ('skip', 'xfail', None, ''):
from pytest import UsageError

View File

@ -893,16 +893,16 @@ class TestMarkDecorator(object):
assert (lhs == rhs) == expected
@pytest.mark.parametrize('mark', [None, 'skip', 'xfail'])
@pytest.mark.parametrize('mark', [None, '', 'skip', 'xfail'])
def test_parameterset_for_parametrize_marks(testdir, mark):
if mark is not None:
testdir.makeini("[pytest]\nempty_parameterset=" + mark)
testdir.makeini("[pytest]\nempty_parameter_set_mark=" + mark)
config = testdir.parseconfig()
from _pytest.mark import pytest_configure, get_empty_parameterset_mark
pytest_configure(config)
result_mark = get_empty_parameterset_mark(config, ['a'], all)
if mark is None:
if mark in (None, ''):
# normalize to the requested name
mark = 'skip'
assert result_mark.name == mark