summaryrefslogtreecommitdiff
path: root/conftest.py
diff options
context:
space:
mode:
authorMatus Valo <matusvalo@gmail.com>2020-04-27 10:14:53 +0200
committerAsif Saif Uddin <auvipy@gmail.com>2020-04-30 10:43:50 +0600
commit3155e9407f3b7169ce13bcf57b13673506476a81 (patch)
treebc9ca8e846b68a992c64d6808414968f7a4bf3f3 /conftest.py
parent8f1de37a08318d388a048341ddca12af30019bf3 (diff)
downloadkombu-3155e9407f3b7169ce13bcf57b13673506476a81.tar.gz
Added integration testing infrastructure for RabbitMQ
Diffstat (limited to 'conftest.py')
-rw-r--r--conftest.py17
1 files changed, 17 insertions, 0 deletions
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)
+