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

Test test_input_string_transform_factory_removes_thousands_separator_and_is_float_aware_with_LOCALE_and_FLOAT_example is failing on last release 5.3.3 #65

Closed
agustinhenze opened this issue Aug 20, 2018 · 6 comments
Labels

Comments

@agustinhenze
Copy link

Hi there, I'm the debian maintainer of this module :). I was packaging last version and I can repeat in a controlled environment the test mentioned on the subject is failing for both Python versions. Python2.7 and Python3.6.

=================================== FAILURES ===================================
 test_input_string_transform_factory_removes_thousands_separator_and_is_float_aware_with_LOCALE_and_FLOAT_example 
test_natsort/test_input_string_transform_factory.py:126: in test_input_string_transform_factory_removes_thousands_separator_and_is_float_aware_with_LOCALE_and_FLOAT_example
    assert _input_string_transform_factory(ns.LOCALE | ns.FLOAT)(x) == '12543642642.534,534980'
E   AssertionError: assert '12,543,642,642.534,534,980' == '12543642642.534,534980'
E     - 12,543,642,642.534,534,980
E     ?   -   -   -           -
E     + 12543642642.534,534980

You can see the detailed log here

https://salsa.debian.org/debian/natsort/-/jobs/40303

@SethMMorton
Copy link
Owner

What is your LOCALE set to? While cleaning up the test suite recently, I noticed that the tests that use locale were making the assumption that the locale was "C" or "en_US". If that is not the case for you it would explain the failure.

@agustinhenze
Copy link
Author

Hi @SethMMorton locale is unset 🤷‍♂️.

In [1]: import locale

In [2]: locale.getdefaultlocale()
Out[2]: (None, None)

So we found the failure, thanks! :)

@SethMMorton
Copy link
Owner

I will update the tests to not make any assumptions about the environment.

@SethMMorton
Copy link
Owner

Is it possible for you to try running the tests as of c749c79 (branch "clarify-code-and-simplify-tests")? All tests using LOCALE should be explicitly setting a locale.

@SethMMorton
Copy link
Owner

Does this still give you problems on 5.4.0?

@agustinhenze
Copy link
Author

Hi @SethMMorton, sorry for the delay. I've packaged last version and it works fine :). Here you can see the output for the tests. So, I'm closing this issue. Thank you very much!

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

No branches or pull requests

2 participants