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

1.4.18: pytest is failing with deprecation message #6617

Closed
kloczek opened this issue Jun 10, 2021 · 8 comments
Closed

1.4.18: pytest is failing with deprecation message #6617

kloczek opened this issue Jun 10, 2021 · 8 comments
Labels
duplicate This issue or pull request already exists external library/application issues a separate library / application that's not SQLAlchemy has a problem (dependent or dependee) tests

Comments

@kloczek
Copy link

kloczek commented Jun 10, 2021

setuptools buils and install in install preffix and thab pytest with PYTHONPATH pointing on install prefix.

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sqlalchemy-1.4.18-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sqlalchemy-1.4.18-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ PYTHONDONTWRITEBYTECODE=1
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/tkloczko/rpmbuild/BUILD/SQLAlchemy-1.4.18/.hypothesis/examples')
rootdir: /home/tkloczko/rpmbuild/BUILD/SQLAlchemy-1.4.18, configfile: setup.cfg
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, Faker-8.4.0, cov-2.12.1, pyfakefs-4.5.0, hypothesis-6.13.14, cases-3.6.1, relaxed-1.1.5
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
Direct construction of SpecModule has been deprecated, please use SpecModule.from_parent.
See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.
========================================================================= short test summary info ==========================================================================
ERROR
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.30s =============================================================================
@kloczek kloczek added the requires triage New issue that requires categorization label Jun 10, 2021
@CaselIT
Copy link
Member

CaselIT commented Jun 10, 2021

Hi,

I think it's one of the plugin you have installed that it's causing this:
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, Faker-8.4.0, cov-2.12.1, pyfakefs-4.5.0, hypothesis-6.13.14, cases-3.6.1, relaxed-1.1.5

please run the test using tox, so that only the necessary plugins are installed.
As you can see, no warning is raised in the same pytest version: https://github.com/sqlalchemy/sqlalchemy/runs/2796354768?check_suite_focus=true

@CaselIT CaselIT added tests third party integration issues issues to do with other libraries and frameworks and removed requires triage New issue that requires categorization labels Jun 10, 2021
@CaselIT CaselIT closed this as completed Jun 10, 2021
@kloczek
Copy link
Author

kloczek commented Jun 10, 2021

tox passes with exit 0 because it runs test in env of exact modules.
Question still remains why this deprecation message is shown because those pytest extensions did not show such messages randomly.

@CaselIT
Copy link
Member

CaselIT commented Jun 10, 2021

You would need to check which of your extensions is triggering it. We don't use them and I personally have never used most of the one listed there, so I'm really not sure how I could help.

Maybe try running pytest with python -Werror -m pytest to see if you can get a stack trace from the cause.

@CaselIT CaselIT added external library/application issues a separate library / application that's not SQLAlchemy has a problem (dependent or dependee) and removed third party integration issues issues to do with other libraries and frameworks labels Jun 10, 2021
@CaselIT
Copy link
Member

CaselIT commented Jun 10, 2021

You may also use the -p flag of pytest:

  -p name               early-load given plugin module name or entry point (multi-allowed).
                        To avoid loading of plugins, use the `no:` prefix, e.g. `no:doctest`.

@zzzeek
Copy link
Member

zzzeek commented Jun 10, 2021

hi -

it looks like you have reported this identical deprecation warning in #6335. SQLAlchemy has not introduced any deprecated use of SpecModule since then, so it should be a given that this is not a SQLAlchemy issue and is again a factor of other plugins in the environment.

@zzzeek zzzeek added the duplicate This issue or pull request already exists label Jun 10, 2021
@kloczek
Copy link
Author

kloczek commented Jun 10, 2021

You would need to check which of your extensions is triggering it. We don't use them and I personally have never used most of the one listed there, so I'm really not sure how I could help.

Maybe try running pytest with python -Werror -m pytest to see if you can get a stack trace from the cause.

Thx for hint.
Just fount that this deprecation message was caused by pytest-relaxed.
Without that ext pytest was able to start.

FYI: running python -m pytest. It is not recommended way to use pytest because started that way has upfront $PWD path added to PYTHONPATH. pytest-dev/pytest#8731
So since that discussion I've changed my way of using pytest and full cycle looks like "setup.pu buils" -> "setup.py install --root </install/prefix>" -> /usr/bin/pytest (with PYTHONPATH pointing to </install/prefix> sitearch and sitelib paths)

@zzzeek
Copy link
Member

zzzeek commented Jun 10, 2021

You would need to check which of your extensions is triggering it. We don't use them and I personally have never used most of the one listed there, so I'm really not sure how I could help.
Maybe try running pytest with python -Werror -m pytest to see if you can get a stack trace from the cause.

Thx for hint.
Just fount that this deprecation message was caused by pytest-relaxed.

hey there -

this is the same thing you found back in #6335. Try to not use this extension please, or at least report the issue to them and not us, thanks!

@kloczek
Copy link
Author

kloczek commented Jun 10, 2021

My fault. This time I've been running pytest manually without using sqlalchemy rpm spec file where I have already BuildConflicts for that module.
My fault. Sorry ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists external library/application issues a separate library / application that's not SQLAlchemy has a problem (dependent or dependee) tests
Projects
None yet
Development

No branches or pull requests

3 participants