diff options
Diffstat (limited to 'tests/frontend/configurable_warnings.py')
-rw-r--r-- | tests/frontend/configurable_warnings.py | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/tests/frontend/configurable_warnings.py b/tests/frontend/configurable_warnings.py index caa91bb61..f756aae2b 100644 --- a/tests/frontend/configurable_warnings.py +++ b/tests/frontend/configurable_warnings.py @@ -11,10 +11,7 @@ from buildstream import _yaml from buildstream.testing.runcli import cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX -TOP_DIR = os.path.join( - os.path.dirname(os.path.realpath(__file__)), - "configuredwarning" -) +TOP_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "configuredwarning") def get_project(fatal_warnings): @@ -25,14 +22,10 @@ def get_project(fatal_warnings): { "origin": "local", "path": "plugins", - "elements": { - "warninga": 0, - "warningb": 0, - "corewarn": 0, - } + "elements": {"warninga": 0, "warningb": 0, "corewarn": 0,}, } ], - "fatal-warnings": fatal_warnings + "fatal-warnings": fatal_warnings, } @@ -47,19 +40,23 @@ def build_project(datafiles, fatal_warnings): @pytest.mark.datafiles(TOP_DIR) -@pytest.mark.parametrize("element_name, fatal_warnings, expect_fatal, error_domain", [ - ("corewarn.bst", [CoreWarnings.OVERLAPS], True, ErrorDomain.STREAM), - ("warninga.bst", ["warninga:warning-a"], True, ErrorDomain.STREAM), - ("warningb.bst", ["warningb:warning-b"], True, ErrorDomain.STREAM), - ("corewarn.bst", [], False, None), - ("warninga.bst", [], False, None), - ("warningb.bst", [], False, None), - ("warninga.bst", [CoreWarnings.OVERLAPS], False, None), - ("warningb.bst", [CoreWarnings.OVERLAPS], False, None), -]) -def test_fatal_warnings(cli, datafiles, element_name, - fatal_warnings, expect_fatal, error_domain): - if HAVE_SANDBOX == 'buildbox' and error_domain != ErrorDomain.STREAM: +@pytest.mark.parametrize( + "element_name, fatal_warnings, expect_fatal, error_domain", + [ + ("corewarn.bst", [CoreWarnings.OVERLAPS], True, ErrorDomain.STREAM), + ("warninga.bst", ["warninga:warning-a"], True, ErrorDomain.STREAM), + ("warningb.bst", ["warningb:warning-b"], True, ErrorDomain.STREAM), + ("corewarn.bst", [], False, None), + ("warninga.bst", [], False, None), + ("warningb.bst", [], False, None), + ("warninga.bst", [CoreWarnings.OVERLAPS], False, None), + ("warningb.bst", [CoreWarnings.OVERLAPS], False, None), + ], +) +def test_fatal_warnings( + cli, datafiles, element_name, fatal_warnings, expect_fatal, error_domain +): + if HAVE_SANDBOX == "buildbox" and error_domain != ErrorDomain.STREAM: pytest.xfail() project_path = build_project(datafiles, fatal_warnings) |