You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
Hit this while running pytest with this module:
../../.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66
../../.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66
../../.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66
../../.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66
/home/jimc/proj/.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
words = pkg_resources.open_text(assets, word_file).readlines()
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
To Reproduce
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error
Create a simple pytest example such as this:
importpytestfromwonderwordsimportRandomWord@pytest.fixture(scope="module")defrandom_word_pair():
"""Return a noun/adjective pair of random words"""w=RandomWord()
noun=w.word(include_categories=["noun"])
adjective=w.word(include_categories=["adjective"])
returnnoun, adjective
then run it:
❯ pytest simpletest.py
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/jimc/testing
collected 0 items
================================================================================================ warnings summary =================================================================================================
.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66
.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66
.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66
.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66
/home/jimc/testing/.venv/lib/python3.11/site-packages/wonderwords/random_word.py:66: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
words = pkg_resources.open_text(assets, word_file).readlines()
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================================================================== 4 warnings in 0.00s ===============================================================================================
Expected behavior
A clear and concise description of what you expected to happen.
No deprecation warnings pertaining to open_text while running pytest.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22]
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
A clear and concise description of what the bug is.
Hit this while running pytest with this module:
To Reproduce
Steps to reproduce the behavior:
Create a simple pytest example such as this:
then run it:
Expected behavior
A clear and concise description of what you expected to happen.
No deprecation warnings pertaining to
open_text
while running pytest.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: