Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run tests with new pytest (4.1.0) #227

Open
dahorak opened this issue Jan 7, 2019 · 2 comments
Open

Unable to run tests with new pytest (4.1.0) #227

dahorak opened this issue Jan 7, 2019 · 2 comments

Comments

@dahorak
Copy link
Contributor

dahorak commented Jan 7, 2019

Last pytest update (to version 4.1.0) breaks execution of any test from usmqe-tests repo:

./pytest_cli.py --color=yes --junit-xml=logs/result.xml -vvvrx usmqe_tests/api/others -m testready -k '' -o junit_suite_name=gluster-arbiter-disperse
ImportError while loading conftest '/var/lib/jenkins/workspace/tendrl-3-ci-usm2-tests-others-api/usmqe-tests/usmqe_tests/conftest.py'.
usmqe_tests/conftest.py:4: in <module>
    import usmqe.usmssh as usmssh
usmqe/usmssh.py:25: in <module>
    LOGGER = pytest.get_logger("ssh", module=True)
E   AttributeError: module 'pytest' has no attribute 'get_logger'
COMMAND: ['python3', '-m', 'pytest', '--ansible-playbook-directory=/var/lib/jenkins/workspace/tendrl-3-ci-usm2-tests-others-api/usmqe-setup', '--ansible-playbook-inventory=/var/lib/jenkins/workspace/tendrl-3-ci-usm2-tests-others-api/usmqe-tests/conf/ci-usm2.hosts', '--color=yes', '--junit-xml=logs/result.xml', '-vvvrx', 'usmqe_tests/api/others', '-m', 'testready', '-k', '', '-o', 'junit_suite_name=gluster-arbiter-disperse']

With pytest 4.0.2, it works correctly.

When fixing this issue, workaround introduced in PR #228 should be removed.

dahorak added a commit to dahorak/usmqe-tests that referenced this issue Jan 7, 2019
It is not possible to run tests with new pytest 4.1.0, so specifying
older version as required.
- usmqe#227
@dahorak
Copy link
Contributor Author

dahorak commented Jan 7, 2019

It seems to be related to:
Removed the implementation of the pytest_namespace hook.[1]
in changelog[2].

Some more information about required code update[3].

[1] pytest-dev/pytest#4421
[2] https://docs.pytest.org/en/latest/changelog.html
[3] https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace

@mbukatov
Copy link
Contributor

mbukatov commented Jan 7, 2019

Hmm, the hook is deprecated since pytest 3.7.0 (2018-07-30).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants