-
Notifications
You must be signed in to change notification settings - Fork 462
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
[tests/bug] improve tests and fix a minor bug #1229
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1229 +/- ##
=======================================
Coverage ? 95.65%
=======================================
Files ? 154
Lines ? 6876
Branches ? 0
=======================================
Hits ? 6577
Misses ? 299
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more.
|
import doctr | ||
|
||
|
||
def test_version(): | ||
assert len(doctr.__version__.split(".")) == 3 | ||
|
||
|
||
@pytest.mark.skipif(doctr.is_torch_available() and doctr.is_tf_available(), reason="torch and tf are available") |
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.
@odulcy-mindee this is better it skips the tests (make tests
works now also if both backends installed if you develop on doctr) and does not effect the CI jobs
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.
Oh yeah, that's even better
["db_resnet34", (3, 512, 512), (1, 512, 512), True, True], | ||
["db_resnet34", (3, 512, 512), (1, 512, 512), True, False], | ||
["db_resnet50", (3, 512, 512), (1, 512, 512), True, True], | ||
["db_resnet50", (3, 512, 512), (1, 512, 512), True, False], | ||
["db_mobilenet_v3_large", (3, 512, 512), (1, 512, 512), True, True], | ||
["db_mobilenet_v3_large", (3, 512, 512), (1, 512, 512), True, False], | ||
["linknet_resnet18", (3, 512, 512), (1, 512, 512), True, True], | ||
["linknet_resnet18", (3, 512, 512), (1, 512, 512), True, False], | ||
["linknet_resnet34", (3, 512, 512), (1, 512, 512), True, True], | ||
["linknet_resnet34", (3, 512, 512), (1, 512, 512), True, False], | ||
["linknet_resnet50", (3, 512, 512), (1, 512, 512), True, True], | ||
["linknet_resnet50", (3, 512, 512), (1, 512, 512), True, False], |
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.
I just discovered we can stack parametrize parameter from documentation (quite useful for train_mode
argument):
import pytest
@pytest.mark.parametrize("x", [0, 1])
@pytest.mark.parametrize("y", [2, 3])
def test_foo(x, y):
pass
We can keep it like that for this PR, that's fine 👍
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.
Ah nice good to know 👍
Yes, I also think that we can slim it down in another PR :)
This PR:
merge_strings
->doctr/models/recognition/utils.py
file_utils.py
andhub.py
because we cannot test some cases or it is already tested by third party lib (e.g.: hf hub)