Always perform at least a basic import check in %check

This commit is contained in:
Miro Hrončok 2023-10-09 20:25:56 +02:00
parent 04a972bc7a
commit 3ddc523acd

View File

@ -138,8 +138,16 @@ sed -i -e 's/^import mock/from unittest import mock/' \
%pyproject_save_files urllib3 %pyproject_save_files urllib3
%if %{with tests}
%check %check
# urllib3.contrib.socks requires urllib3[socks]
# urllib3.contrib.ntlmpool is deprecated and requires ntlm
# urllib3.contrib.securetransport is macOS only
# urllib3.contrib.pyopenssl requires urllib3[secure]
%{pyproject_check_import %{!?with_extras:-e urllib3.contrib.socks}
-e urllib3.contrib.ntlmpool
-e urllib3.contrib.securetransport
-e urllib3.contrib.pyopenssl}
%if %{with tests}
# Drop the dummyserver tests in koji. They fail there in real builds, but not # Drop the dummyserver tests in koji. They fail there in real builds, but not
# in scratch builds (weird). # in scratch builds (weird).
ignore="${ignore-} --ignore=test/with_dummyserver/" ignore="${ignore-} --ignore=test/with_dummyserver/"