Skip to content

Resolve warnings reported by the test suite - #94

Open
acollins3 wants to merge 2 commits into
mainfrom
fix-test-warnings
Open

acollins3 wants to merge 2 commits into
mainfrom
fix-test-warnings

Conversation

@acollins3

Copy link
Copy Markdown
Collaborator

Removes the six warnings left at the end of a pytest tests examples run.

  • Geomean: suppress numpy's log(0) / log(<0) warnings in the calculation. Results are unchanged.
  • Tests: assert the two expected warnings (failing info collector, derived metric without a unit) with pytest.warns.
  • Triton: default TRITON_DEFAULT_FP_FUSION=1 in conftest.py to keep current behavior and silence the 3.9 notice.

A run of tests and examples ended with six warnings:

- Suppress numpy's log(0) and log(<0) RuntimeWarnings in the Geomean
  calculation. The results are unchanged; users with a metric whose mean is
  zero no longer see a raw numpy warning.
- Assert the expected warnings in test_collector_error_handling and
  test_no_args_function_with_derive_metric with pytest.warns, instead of
  letting them reach the warnings summary.
- Default TRITON_DEFAULT_FP_FUSION to 1 in conftest.py, which keeps Triton's
  current behavior and silences its Triton 3.9 notice about the default
  changing in 3.10.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Alex Collins <acollins@nvidia.com>
Comment thread tests/test_profiler.py Outdated
Comment on lines +312 to +313
with pytest.warns(UserWarning, match="does not have a unit specified"):
result = no_args_with_transform()

@Alok-Joshi Alok-Joshi Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should instead update the derive_metric function to return an unit

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point, that is the better fix. Done

test_no_args_function_with_derive_metric is about derive_metric on a function
without arguments, not about the missing-unit warning, which another test in
the same file already asserts. Return (value, unit) so the warning is not
raised, instead of expecting it with pytest.warns.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Alex Collins <acollins@nvidia.com>
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.

2 participants