Summary: | dev-python/pytest-mock-1.11.2 fails almost all tests | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Paolo Pedroni <paolo.pedroni> |
Component: | Current packages | Assignee: | Zac Medico <zmedico> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexey+gentoo, jstein, mgorny, python, renata.nagtalon, sam |
Priority: | Normal | Keywords: | TESTFAILURE |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
pytest-mock-1.11.2:20200326-105948.log.gz
build.log (ppc) pytest-mock-1.11.2.ebuild |
Description
Paolo Pedroni
2020-03-26 14:05:46 UTC
Created attachment 627046 [details]
build.log (ppc)
Fails the same tests on ppc too.
[...]
FAILED tests/test_pytest_mock.py::test_deprecated_mock - Failed: nomatch: '*DeprecationWarning: "mock...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[ANY] - ValueError: unknown configuration value:...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[call] - ValueError: unknown configuration value...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[create_autospec] - ValueError: unknown configur...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[MagicMock] - ValueError: unknown configuration ...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[Mock] - ValueError: unknown configuration value...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[mock_open] - ValueError: unknown configuration ...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[NonCallableMock] - ValueError: unknown configur...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[PropertyMock] - ValueError: unknown configurati...
FAILED tests/test_pytest_mock.py::test_mocker_aliases[sentinel] - ValueError: unknown configuration v...
FAILED tests/test_pytest_mock.py::test_monkeypatch_native - assert 0 == 1
FAILED tests/test_pytest_mock.py::test_plain_stopall - Failed: nomatch: '* 1 passed in *'
======================= 12 failed, 3 passed, 2 xfailed, 27 error in 4.42 seconds =======================
* ERROR: dev-python/pytest-mock-1.11.2::gentoo failed (test phase):
* Tests fail with python2.7
Created attachment 628128 [details]
pytest-mock-1.11.2.ebuild
The problem is that pytest-mock is not installed and thus pytest cannot find the plugin mock. As all tests are supposed to test that plugin, nearly everything fails. To fix this, use distutils_install_for_testing in python_test().
Doing this also fixes some other tests which are currently deactivated without a notice. I took the liberty to investigate all the tests and whether they still need to be deactivated and if so why. It turned out that with proper arguments only the test test_standalone_mock needs to be disabled.
You can find the resulting ebuild attached.
arm64: FAILED tests/test_pytest_mock.py::test_deprecated_mock - Failed: nomatch: '*DeprecationWarning: "mock" fixture has been deprecated, use "mocker"*' FAILED tests/test_pytest_mock.py::test_mocker_aliases[ANY] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_mocker_aliases[call] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_mocker_aliases[create_autospec] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_mocker_aliases[MagicMock] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_mocker_aliases[Mock] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_mocker_aliases[mock_open] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_mocker_aliases[NonCallableMock] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_mocker_aliases[PropertyMock] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_mocker_aliases[sentinel] - ValueError: unknown configuration value: u'mock_use_standalone_module' FAILED tests/test_pytest_mock.py::test_monkeypatch_native - assert 0 == 1 Thank you for your research. I'm going to use this in 2.0.0 bump. The affected version (pytest-mock-1.11.2) is no longer in the tree and newer versions have a functioning test setup (Thanks Michał Górny!), so I think this issue can be closed. Thanks for noticing. |