In conftest.py
:
1 | def pytest_addoption(parser): |
1 | @pytest.fixture |
In config.py
:
1 | config_dict = { |
For different test case executions:1
2
3
4
5
6
7
8def run_query(self, scope, query_func, *args):
query = query_func(scope, *args)
if self._mode == TestMode.SQL:
...
elif self._mode == TestMode.DATA:
...
...
For command line test usage:1
2
3
4pytest -q tests/test_derived.py --test_mode=update_sql
pytest -q tests/test_derived.py --test_mode=sql
pytest -q tests/test_derived.py --test_mode=update_data
pytest -q tests/test_derived.py --test_mode=data
For more information and easier examples, click here