check-patroni/tests/conftest.py
benoit d99faeba15 Add tests for the output of the script and support pre/post 3.0.4
* Change all replica status from `running` to `streaming`
* Add an option to pytest to change the state back to `running`
* Also tests the output of the script
* Add a quick test script for live clusters
2023-08-23 10:53:09 +02:00

13 lines
415 B
Python

def pytest_addoption(parser):
"""
Add CLI options to `pytest` to pass those options to the test cases.
These options are used in `pytest_generate_tests`.
"""
parser.addoption("--use-old-replica-state", action="store_true", default=False)
def pytest_generate_tests(metafunc):
metafunc.parametrize(
"use_old_replica_state", [metafunc.config.getoption("use_old_replica_state")]
)