From 10feb30c701d3cf264746d0d81bd566f002de24b Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 22 Apr 2019 09:18:55 +0200 Subject: test/py: pytest.mark.notbuildconfigspec() We already can let a Python test depend on a build option being set via @pytest.mark.buildconfigspec(). It may be necessary to let a test depend on a build option *not* being set. So let's introduce @pytest.mark.notbuildconfigspec for this purpose. Signed-off-by: Heinrich Schuchardt --- test/py/conftest.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test/py/conftest.py') diff --git a/test/py/conftest.py b/test/py/conftest.py index e40cbf0ba12..00d8ef8ba99 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -460,11 +460,15 @@ def setup_buildconfigspec(item): """ mark = item.get_marker('buildconfigspec') - if not mark: - return - for option in mark.args: - if not ubconfig.buildconfig.get('config_' + option.lower(), None): - pytest.skip('.config feature "%s" not enabled' % option.lower()) + if mark: + for option in mark.args: + if not ubconfig.buildconfig.get('config_' + option.lower(), None): + pytest.skip('.config feature "%s" not enabled' % option.lower()) + notmark = item.get_marker('notbuildconfigspec') + if notmark: + for option in notmark.args: + if ubconfig.buildconfig.get('config_' + option.lower(), None): + pytest.skip('.config feature "%s" enabled' % option.lower()) def tool_is_in_path(tool): for path in os.environ["PATH"].split(os.pathsep): -- cgit v1.2.3