From 283807a8146df0f2c672ac46f18bbd37df0b9fa3 Mon Sep 17 00:00:00 2001 From: Carl George Date: Tue, 6 Oct 2020 21:35:22 -0500 Subject: [PATCH] Fix skipping tests on el8 pytest's -k flag doesn't accept `"not ()"` as an expression. --- python-trustme.spec | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/python-trustme.spec b/python-trustme.spec index 357d5ad..059814d 100644 --- a/python-trustme.spec +++ b/python-trustme.spec @@ -18,13 +18,6 @@ which nobody trusts. But you can trust it. Trust me.} %bcond_without tests -%if %{defined el8} -# The upstream test suite uses cryptography's rfc4514_string method, which -# wasn't added until version 2.5. RHEL 8 currently only provides version 2.3. -# https://cryptography.io/en/latest/changelog/?highlight=rfc4514_string#v2-5 -%global skip_list test_ca_custom_names or test_issue_cert_custom_names -%endif - Name: python-%{pkgname} Version: 0.6.0 @@ -67,7 +60,15 @@ rm -rf %{eggname}.egg-info %if %{with tests} %check -%pytest --verbose -k "not (%{?skip_list})" +%if %{defined el8} +# The upstream test suite uses cryptography's rfc4514_string method, which +# wasn't added until version 2.5. RHEL 8 currently only provides version 2.3. +# https://cryptography.io/en/latest/changelog/?highlight=rfc4514_string#v2-5 +%pytest --verbose -k "not (test_ca_custom_names or test_issue_cert_custom_names)" +%else +%pytest --verbose +%endif + %endif