Overview
Request 827019 accepted
- Fix test failures by testing the source directory in multibuild
I still believe the tests should check what is actually being installed, but you are the boss.
- Created by bnavigator
- In state accepted
-
Package maintainer:
bnavigator
- Supersedes 826224
but the tests work evenbefore this change?
No they don't! For quite a while: https://build.opensuse.org/packages/python-pytest-astropy-header:test/job_history/devel:languages:python:pytest/openSUSE_Tumbleweed/x86_64
[ 52s] ___________________________ test_modify_in_conftest ____________________________ [ 52s] [ 52s] testdir = <Testdir local('/tmp/pytest-of-abuild/pytest-0/test_modify_in_conftest0')> [ 52s] capsys = <_pytest.capture.CaptureFixture object at 0x7fba06669610> [ 52s] [ 52s] def test_modify_in_conftest(testdir, capsys): [ 52s] testdir.makeconftest(""" [ 52s] from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS [ 52s] [ 52s] def pytest_configure(config): [ 52s] config.option.astropy_header = True [ 52s] PYTEST_HEADER_MODULES.pop('Pandas') [ 52s] PYTEST_HEADER_MODULES['scikit-image'] = 'skimage' [ 52s] TESTED_VERSIONS['fakepackage'] = '1.0.2' [ 52s] """) [ 52s] testdir.inline_run() [ 52s] out, err = capsys.readouterr() [ 52s] > assert err == '' [ 52s] E assert "ImportError ...opy_header'\n" == '' [ 52s] E + ImportError while loading conftest '/tmp/pytest-of-abuild/pytest-0/test_modify_in_conftest0/conftest.py'. [ 52s] E + conftest.py:1: in <module> [ 52s] E + from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS [ 52s] E + E ModuleNotFoundError: No module named 'pytest_astropy_header'
@scarabeus_iv, I take despite this failure and the demo in https://build.opensuse.org/package/show/home:bnavigator:python-multibuild-demo/python-hypothesis#comment-1283363 you are still not convinced that multibuild test flavors normally need to require the base package?
Alternative: For pure python packages with %pytest
one could often add $(pwd)
to PYTHONPATH
. This does not work for extension packages with %pytest_arch
though. You need the compiled stuff and then it is worth not to compile twice for non-test and test.
yep for the compiled stuff it makes sense, but for native packages exporting the pwd is actually easier solution tbh
Request History
bnavigator created request
- Fix test failures by testing the source directory in multibuild
I still believe the tests should check what is actually being installed, but you are the boss.
scarabeus_iv accepted request