Skip to content

Comments

batch error logs#484

Merged
hussain-jafari merged 16 commits intoepic/full_scale_testingfrom
hjafari/MIC-5503_batch_error_logs
Jan 24, 2025
Merged

batch error logs#484
hussain-jafari merged 16 commits intoepic/full_scale_testingfrom
hjafari/MIC-5503_batch_error_logs

Conversation

@hussain-jafari
Copy link
Contributor

batch error logs

Description

  • Category: feature
  • JIRA issue: MIC-5503

Add with checks.

Testing

Added multiple assert statements that would fail using with check and verified that they all appeared in the output logs.

Copy link
Collaborator

@zmbc zmbc left a comment

Choose a reason for hiding this comment

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

Cool!

assert not original_data.index.difference(noised_data.index).empty
with check:
assert noised_data.index.difference(original_data.index).empty
assert not original_data.index.difference(noised_data.index).empty
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these be in two separate checks?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is confusing to me

import pandas as pd
import pytest
from _pytest.fixtures import FixtureRequest
from pytest_check import check # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

jw why this type errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There aren't any stubs for pytest_check

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can just ignore that in the project level file and not in this specific file

def test_release_tests(pytest_args: list[str]) -> None:
os.chdir(Path(__file__).parent) # need this to access cli options from conftest.py
base_cmd = ["pytest", "--release", "test_release.py"]
base_cmd = ["pytest", "--release", "test_release.py", "--check-max-tb=1000"]
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This flag controls how many failures are shown at once and, oddly enough, defaults to 1.

(
check_original.reset_index()[unnoised_id_cols]
== check_noised.reset_index()[unnoised_id_cols]
with check:
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's only one assertion, so what's the point of putting this in a check block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah this is actually unnecessary

@hussain-jafari hussain-jafari merged commit a60c071 into epic/full_scale_testing Jan 24, 2025
8 checks passed
@hussain-jafari hussain-jafari deleted the hjafari/MIC-5503_batch_error_logs branch January 24, 2025 23:40
hussain-jafari added a commit that referenced this pull request Feb 10, 2025
Category: feature
JIRA issue: MIC-5503
Add with checks.

Testing
Added multiple assert statements that would fail using with check and verified that they all appeared in the output logs.
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.

6 participants