-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
PluginValidationError
: unknown hook 'pytest_fixture_plus'
#6475
Comments
I see you have provided of renaming the symbol in the issue... AFAIK there's no other workaround. I guess it would be possible to add support in pluggy to somehow mark a symbol as "not a hook", but I'm not sure it is worth the effort, and this happens only in pytest for historical reasons: pluggy recommend marking hooks with the |
Closing for now, but feel free to follow up with further questions. 👍 |
It seems that I could decorate the symbols whose name starts with Do you confirm that this would not have any other side effect ? Note that would be very weird as these symbols are not hooks at all, they just have names starting with |
another simple fix is to use |
Yes I had noted that one smarie/python-pytest-cases#71 (comment) But the effort in on the users side, that's why I would prefer the If you feel this could work at least for a few versions, I can plan a name transition. |
as long as its also documented that this is a time bomb in the sense that its just waiting for someone to register a hook with that name |
lets open a pluggy issue for marking something as NOT A HOOK |
…ture_plus`. For more information see: pytest-dev/pytest#6475.
…ture_plus`. For more information see: pytest-dev/pytest#6475.
…ture_plus`. For more information see: pytest-dev/pytest#6475.
…ture_plus`. For more information see: pytest-dev/pytest#6475.
…ture_plus`. For more information see: pytest-dev/pytest#6475.
…ture_plus`. For more information see: pytest-dev/pytest#6475.
…ture_plus`. For more information see: pytest-dev/pytest#6475.
This PR fixes a few separate warnings in pytests. Examples: ``` ../../../../../../opt/conda/envs/test/lib/python3.9/site-packages/hypothesis/_settings.py:467 /opt/conda/envs/test/lib/python3.9/site-packages/hypothesis/_settings.py:467: HypothesisDeprecationWarning: `Healthcheck.all()` is deprecated; use `list(HealthCheck)` instead. The `hypothesis codemod` command-line tool can automatically refactor your code to fix this warning. note_deprecation( ../../../../../../opt/conda/envs/test/lib/python3.9/site-packages/cuml/internals/safe_imports.py:469 /opt/conda/envs/test/lib/python3.9/site-packages/cuml/internals/safe_imports.py:469: DeprecationWarning: Please use `approx_fprime` from the `scipy.optimize` namespace, the `scipy.optimize.optimize` namespace is deprecated. return getattr(imported_module, symbol) test_device_selection.py:192 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:192: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @pytest_fixture_plus( ``` Authors: - Bradley Dice (https://github.com/bdice) - Dante Gama Dessavre (https://github.com/dantegd) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) - Dante Gama Dessavre (https://github.com/dantegd) URL: #5436
This PR fixes some warnings in tests by using `pytest_cases.fixture` instead of `pytest_cases.fixture_plus`. ``` test_device_selection.py:198 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:198: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:235 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:235: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:277 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:277: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:317 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:317: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:357 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:357: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:392 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:392: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:440 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:440: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:480 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:480: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:519 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:519: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( ``` Authors: - Bradley Dice (https://github.com/bdice) - Dante Gama Dessavre (https://github.com/dantegd) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) URL: #5798
This PR fixes some warnings in tests by using `pytest_cases.fixture` instead of `pytest_cases.fixture_plus`. ``` test_device_selection.py:198 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:198: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:235 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:235: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:277 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:277: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:317 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:317: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:357 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:357: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:392 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:392: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:440 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:440: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:480 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:480: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( test_device_selection.py:519 /__w/cuml/cuml/python/cuml/tests/test_device_selection.py:519: DeprecationWarning: `pytest_fixture_plus` and `fixture_plus` are deprecated. Please use the new alias `fixture`. See pytest-dev/pytest#6475 @fixture_plus( ``` Authors: - Bradley Dice (https://github.com/bdice) - Dante Gama Dessavre (https://github.com/dantegd) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) URL: rapidsai#5798
From smarie/python-pytest-cases#71
When the user writes
from pytest_cases import pytest_fixture_plus
in hisconftest.py
, the symbol is mistakenly thought as being a plugin hook bypytest
, because the symbol name starts withpytest_
.My question is therefore simple: what is the recommended way to fix this issue in
pytest_cases
without renaming the symbol ?The text was updated successfully, but these errors were encountered: