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

Some tests fails with pytest-randomly #105

Closed
mtelka opened this issue Apr 2, 2023 · 1 comment · Fixed by #204 · May be fixed by dangillet/humanize#1
Closed

Some tests fails with pytest-randomly #105

mtelka opened this issue Apr 2, 2023 · 1 comment · Fixed by #204 · May be fixed by dangillet/humanize#1
Labels
good first issue Good for newcomers help wanted Extra attention is needed testing Unit tests, linting, CI, etc.

Comments

@mtelka
Copy link

mtelka commented Apr 2, 2023

What did you do?

I ran tests with pytest-randomly plugin installed.

What did you expect to happen?

All tests pass.

What actually happened?

Few tests failed.

What versions are you using?

  • OS: OpenIndiana
  • Python: 3.9.16
  • Humanize: 4.6.0

Example of failed tests:

=========================== short test summary info ============================
FAILED tests/test_i18n.py::test_ordinal_genders[es_ES-1-male-1\xba] - Excepti...
FAILED tests/test_i18n.py::test_intword_plurals[es_ES-1000000000-1.0 bill\xf3n]
FAILED tests/test_i18n.py::test_langauge_codes[ar-5\u062e\u0627\u0645\u0633]
FAILED tests/test_i18n.py::test_intword_plurals[es_ES-1000000000000-1.0 trill\xf3n]
FAILED tests/test_i18n.py::test_langauge_codes[fr-5e] - Exception: Humanize c...
FAILED tests/test_i18n.py::test_langauge_codes[ar_SA-5\u062e\u0627\u0645\u0633]
FAILED tests/test_i18n.py::test_ordinal_genders[fr_FR-1-male-1er] - Exception...
FAILED tests/test_i18n.py::test_ordinal_genders[es_ES-5-female-5\xaa] - Excep...
FAILED tests/test_i18n.py::test_intword_plurals[es_ES-6700000000000-6.7 trillones]
FAILED tests/test_i18n.py::test_intword_plurals[es_ES-1000000-1.0 mill\xf3n]
FAILED tests/test_i18n.py::test_langauge_codes[pt_BR-5\xba] - Exception: Huma...
FAILED tests/test_i18n.py::test_ordinal_genders[it_IT-8-female-8\xaa] - Excep...
FAILED tests/test_i18n.py::test_naturaldelta - Exception: Humanize cannot det...
FAILED tests/test_i18n.py::test_intcomma - Exception: Humanize cannot determi...
FAILED tests/test_i18n.py::test_langauge_codes[pt-5\xba] - Exception: Humaniz...

Please note the list and number of failed tests differs with every test run.

@hugovk
Copy link
Member

hugovk commented Apr 2, 2023

Thanks, my guess is https://github.com/python-humanize/humanize/blob/main/tests/test_i18n.py could better handle activation and deactivation of i18n. PR welcome to improve it!

@hugovk hugovk added good first issue Good for newcomers help wanted Extra attention is needed testing Unit tests, linting, CI, etc. labels Apr 2, 2023
dangillet added a commit to dangillet/humanize that referenced this issue Sep 22, 2024
Fixes python-humanize#105

Use importlib.resources available since Python 3.9 to find the location
of the locale folder containing the translations.
dangillet added a commit to dangillet/humanize that referenced this issue Sep 23, 2024
Fixes python-humanize#105

Use importlib.resources available since Python 3.9 to find the location
of the locale folder containing the translations.
@hugovk hugovk closed this as completed in 9627694 Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed testing Unit tests, linting, CI, etc.
Projects
None yet
2 participants