diff options
author | Thomas Grainger <tagrain@gmail.com> | 2021-07-20 14:07:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 19:07:49 +0600 |
commit | 241b5dcff8a7c8ad411e1b325d59e47acfa9e1ed (patch) | |
tree | 14b5c70fb2e2e2e4c53356d8a21da0540da16759 /conftest.py | |
parent | 1ce0afe39ab26487c1cdfd9d4ba8c5bb445c8f32 (diff) | |
download | kombu-241b5dcff8a7c8ad411e1b325d59e47acfa9e1ed.tar.gz |
enable pre-commit (#1355)
* enable pre-commit
* use extend-ignore for flake8
* manual flake8 fixes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update kombu/__init__.py
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'conftest.py')
-rw-r--r-- | conftest.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/conftest.py b/conftest.py index f6d7d655..ab0a5d90 100644 --- a/conftest.py +++ b/conftest.py @@ -1,17 +1,29 @@ import pytest + + def pytest_addoption(parser): - parser.addoption("-E", action="append", metavar="NAME", - help="only run tests matching the environment NAME.") + 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") + 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: + 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) - |