From 3155e9407f3b7169ce13bcf57b13673506476a81 Mon Sep 17 00:00:00 2001 From: Matus Valo Date: Mon, 27 Apr 2020 10:14:53 +0200 Subject: Added integration testing infrastructure for RabbitMQ --- conftest.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 conftest.py (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py new file mode 100644 index 00000000..f6d7d655 --- /dev/null +++ b/conftest.py @@ -0,0 +1,17 @@ +import pytest +def pytest_addoption(parser): + parser.addoption("-E", action="append", metavar="NAME", + help="only run tests matching the environment NAME.") + +def pytest_configure(config): + # register an additional marker + config.addinivalue_line("markers", + "env(name): mark test to run only on named environment") + +def pytest_runtest_setup(item): + envnames = [mark.args[0] for mark in item.iter_markers(name='env')] + if envnames: + if item.config.getoption("-E") is None or len(set(item.config.getoption("-E")) & set(envnames)) == 0: + # We skip test if does not mentioned by -E param + pytest.skip("test requires env in %r" % envnames) + -- cgit v1.2.1