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
correct copy of attributes #629
correct copy of attributes #629
Conversation
48a0f7b
to
5b48c6a
Compare
5b48c6a
to
58885ea
Compare
tests/test_money.py
Outdated
assert one._decimal_places_display is None, "this should be None" | ||
assert one.decimal_places == 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, I'd prefer a bit higher level assertions (at least in new tests) - e.g. how values will be formatted, as these attributes are telling more about implementation details.
tests/test_money.py
Outdated
assert three.decimal_places == 2 | ||
|
||
|
||
def test_add_copy_display_places(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it will be nice to use pytest.mark.parametrize
as these 3 tests have similar structure
Thanks for working on this! |
Codecov Report
@@ Coverage Diff @@
## master #629 +/- ##
=======================================
Coverage 97.94% 97.94%
=======================================
Files 29 29
Lines 971 973 +2
Branches 164 165 +1
=======================================
+ Hits 951 953 +2
Misses 13 13
Partials 7 7
Continue to review full report at Codecov.
|
you are welkom, I have changed the tests as best I can. Let me know if it can be better. |
c57f3e4
to
f6fd044
Compare
Released in 2.0.2 |
After an action like adding the attribute decimal_places_display was incorrectly set and it was interfering with formatting in the str. Even the deprecation warning was triggered.
This fix only copy the internal attributes and avoids incorrectly setting them.
Small proof of issue (Version 2.0.1) Also notice formatting problem.