-
Notifications
You must be signed in to change notification settings - Fork 68
update to all tests that used annotation_submit_fn #327
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
Conversation
tests/integration/conftest.py
Outdated
| client, project.uid, f'label-import-{uuid.uuid4()}', predictions) | ||
| upload_task.wait_until_done() | ||
| labels = annotation_submit_fn(project.uid, data_row.uid) | ||
| labels = [label.uid for label in project.labels()][0] |
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.
why only the zeroth index?
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.
configured_project_with_label used to only return 1 id in the labels var, so the test that used it did this:
model_run.upsert_labels([label_id])
i can change the test itself to just take in (label_id) instead of ([label_id]) if that makes more sense, and to keep labels as the whole list
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.
actually looking at how the asserts are set up, it looks like it does expect it to just be one. let me know if i should change the asserts to account for multiple labels too, or if leaving it as the 0th index is okay
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.
ohh I was mislead by the variable name. labels is just a single label. Ok then you can just do:
label = next(project.labels()).uid
yield [project, label]
That way it won't confuse people in the future
tests/integration/conftest.py
Outdated
| upload_task.wait_until_done() | ||
| labels = annotation_submit_fn(project.uid, data_row.uid) | ||
| labels = [label.uid for label in project.labels()][0] | ||
| time.sleep(3) |
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.
You can scrap this sleep timer
No description provided.