From 472671190c2d31618413cdb270cabde0ca67f717 Mon Sep 17 00:00:00 2001 From: q-posev Date: Thu, 25 May 2023 18:52:52 +0200 Subject: [PATCH] Add config file for pytest --- python/test/conftest.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 python/test/conftest.py diff --git a/python/test/conftest.py b/python/test/conftest.py new file mode 100644 index 0000000..725b94c --- /dev/null +++ b/python/test/conftest.py @@ -0,0 +1,17 @@ +# content of conftest.py +import pytest + + +def pytest_addoption(parser): + parser.addoption( + "--all", action="store_true", help="Run all back-ends" + ) + + +def pytest_generate_tests(metafunc): + if "backend" in metafunc.fixturenames: + if metafunc.config.getoption("all"): + backends = ['hdf5', 'text'] + else: + backends = ['text'] + metafunc.parametrize("backend", backends)