Skip to content

test: Add CPU unit tests for tools/utils.py#2421

Open
HemantSudarshan wants to merge 1 commit intopytorch:mainfrom
HemantSudarshan:feat/cpu-unit-tests-utils
Open

test: Add CPU unit tests for tools/utils.py#2421
HemantSudarshan wants to merge 1 commit intopytorch:mainfrom
HemantSudarshan:feat/cpu-unit-tests-utils

Conversation

@HemantSudarshan
Copy link

Add tests/unit_tests/test_utils.py with comprehensive CPU-only tests:

  • TestRoundUp: exact multiples, non-multiples, edge cases, large values
  • TestGetPeakFlops: all 11 GPU name branches plus lspci override
  • TestColorDataclasses: ANSI codes, empty strings, field parity, frozen
  • TestSetDefaultDtype: context manager, exception safety, nesting
  • TestCheckIfFeatureInPytorch: source build, old nightly, and happy path
  • TestGarbageCollection: init, frequency-based collection, static method

Add tests/unit_tests/test_utils.py with comprehensive CPU-only tests:
- TestRoundUp: exact multiples, non-multiples, edge cases, large values
- TestGetPeakFlops: all 11 GPU name branches plus lspci override
- TestColorDataclasses: ANSI codes, empty strings, field parity, frozen
- TestSetDefaultDtype: context manager, exception safety, nesting
- TestCheckIfFeatureInPytorch: source build, old nightly, and happy path
- TestGarbageCollection: init, frequency-based collection, static method
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant