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

try unit conversion instead of literal dimensionality check #99 #101

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

mmarras
Copy link
Contributor

@mmarras mmarras commented Aug 10, 2024

Closes #99.

No extra test needed, coverage remained the same.

py38-django32: OK (38.93=setup[23.56]+cmd[15.37] seconds)
py39-django32: OK (41.60=setup[31.53]+cmd[10.07] seconds)
py310-django32: OK (42.34=setup[30.75]+cmd[11.59] seconds)
py311-django32: OK (41.89=setup[31.09]+cmd[10.80] seconds)
py38-django42: OK (47.90=setup[31.02]+cmd[16.88] seconds)
py39-django42: OK (41.26=setup[30.63]+cmd[10.63] seconds)
py310-django42: OK (42.95=setup[31.91]+cmd[11.04] seconds)
py311-django42: OK (40.84=setup[30.06]+cmd[10.78] seconds)
congratulations :) (337.97 seconds)

@mmarras
Copy link
Contributor Author

mmarras commented Aug 11, 2024

Actually I was just thinking if you wanted me to write a test that check that the context actually works.
Please comment, I can still do that. I just did.

@mmarras
Copy link
Contributor Author

mmarras commented Aug 11, 2024

Added tests for the context functionality

In test_helper.py
---------- coverage: platform linux, python 3.11.9-final-0 -----------

Name Stmts Miss Branch BrPart Cover Missing
src/quantityfield/init.py 5 0 0 0 100%
src/quantityfield/fields.py 176 1 44 1 99% 327
src/quantityfield/helper.py 11 0 2 0 100%
src/quantityfield/settings.py 5 0 0 0 100%
src/quantityfield/units.py 2 0 0 0 100%
src/quantityfield/widgets.py 22 0 6 0 100%
TOTAL 221 1 52 1 99%

Coverage XML written to file coverage.xml

======================================== 206 passed, 2 xfailed, 16 warnings in 6.92s =========================================
py311-django42: docker> remove 'a5f4ddc79e35' (from 'postgres')
py38-django32: OK (32.18=setup[20.12]+cmd[12.06] seconds)
py39-django32: OK (26.57=setup[18.04]+cmd[8.53] seconds)
py310-django32: OK (27.35=setup[17.91]+cmd[9.44] seconds)
py311-django32: OK (27.32=setup[17.81]+cmd[9.51] seconds)
py38-django42: OK (30.49=setup[18.17]+cmd[12.32] seconds)
py39-django42: OK (26.82=setup[18.32]+cmd[8.50] seconds)
py310-django42: OK (27.72=setup[18.27]+cmd[9.45] seconds)
py311-django42: OK (27.41=setup[17.99]+cmd[9.42] seconds)
congratulations :) (226.09 seconds)

Comment on lines 33 to 34
class TestContextHandling(TestCase):
def setUp(self):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the other lack it as well but could you add some doc string explaining why the test are needed?
May also refer to the isseue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@CarliJoy
Copy link
Owner

LGTM beside the missing docstring for the test. Now I think I understood what is happing.

@CarliJoy CarliJoy merged commit 06ac300 into CarliJoy:main Aug 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pint context
2 participants