diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-25 17:34:55 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-25 17:34:55 -0700 |
commit | d1f0c6621036bfb801066b2c34fe5bff6f234388 (patch) | |
tree | fa7c955afae211f032a492162664941e060ff77b /tests/utils.py | |
parent | daca59235c6be9ae11044aa8bb14e137c0435dd2 (diff) | |
parent | 902d8cfd58de395748d71f449944faa9dbac8725 (diff) | |
download | cryptography-d1f0c6621036bfb801066b2c34fe5bff6f234388.tar.gz cryptography-d1f0c6621036bfb801066b2c34fe5bff6f234388.tar.bz2 cryptography-d1f0c6621036bfb801066b2c34fe5bff6f234388.zip |
Merge pull request #1437 from reaperhulk/conftest-changes
filter backends during initial generation to elide tests entirely
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/utils.py b/tests/utils.py index bc5bc1ea..acc6c141 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -40,8 +40,6 @@ def select_backends(names, backend_list): if names is None: return backend_list split_names = [x.strip() for x in names.split(',')] - # this must be duplicated and then removed to preserve the metadata - # pytest associates. Appending backends to a new list doesn't seem to work selected_backends = [] for backend in backend_list: if backend.name in split_names: @@ -55,6 +53,15 @@ def select_backends(names, backend_list): ) +def skip_if_empty(backend_list, required_interfaces): + if not backend_list: + pytest.skip( + "No backends provided supply the interface: {0}".format( + ", ".join(iface.__name__ for iface in required_interfaces) + ) + ) + + def check_backend_support(item): supported = item.keywords.get("supported") if supported and "backend" in item.funcargs: |