Files
pytorch/test/lazy/test_bindings.py
Anthony Barbier cf9cad31df Add __main__ guards to tests (#154716)
This PR is part of a series attempting to re-submit https://github.com/pytorch/pytorch/pull/134592 as smaller PRs.

Add missing `if __name__ == "__main__":` guards to some tests.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154716
Approved by: https://github.com/Skylion007
2025-06-04 14:38:13 +00:00

14 lines
304 B
Python

# Owner(s): ["oncall: jit"]
import torch._lazy.metrics
from torch.testing._internal.common_utils import run_tests
def test_metrics():
names = torch._lazy.metrics.counter_names()
assert len(names) == 0, f"Expected no counter names, but got {names}"
if __name__ == "__main__":
run_tests()