Workaround import mishmash in %check

The namespace sphinxcontrib package made this problematic,
because the package in $pwd was not namespace, but regular.

Alternatively, sphinxcontrib/__init__.py could have been deleted,
but not in %prep, because the package does not install without it.

This solution makes sure we are testing what we are shipping.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1733681
This commit is contained in:
Miro Hrončok 2019-07-27 12:39:05 +02:00
parent 2ed31f5a40
commit fa1711963b

View File

@ -50,7 +50,11 @@ rm -rf %{pypi_name}.egg-info
%py3_install
%check
%{__python3} -m pytest tests/
mkdir empty && pushd empty # don't run the tests from sources
export PYTHONPATH=%{buildroot}%{python3_sitelib}
%{__python3} -m pytest ../tests
popd
rmdir empty
%files -n python3-%{pypi_name}
%license LICENSE