Enable UFMT format on test/license.py test/logging.py (#125737)

Fixes some files in #123062

Run lintrunner on files:
test/license.py test/logging.py

```bash
$ lintrunner -a --take UFMT --all-files
ok No lint issues.
Successfully applied all patches.
```
Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/125737
Approved by: https://github.com/ezyang, https://github.com/malfet
This commit is contained in:
hippocookie
2024-05-11 01:52:35 +00:00
committed by PyTorch MergeBot
parent a5c93a6899
commit 01fb9676b8
3 changed files with 21 additions and 17 deletions

View File

@ -1,7 +1,7 @@
# Owner(s): ["module: unknown"]
import torch
from torch.testing._internal.common_utils import TestCase, run_tests
from torch.testing._internal.common_utils import run_tests, TestCase
class LoggingTest(TestCase):
@ -14,9 +14,11 @@ class LoggingTest(TestCase):
s = TestCase.runWithPytorchAPIUsageStderr("import torch")
self.assertRegex(s, "PYTORCH_API_USAGE.*import")
# import the shared library directly - it triggers static init but doesn't call anything
s = TestCase.runWithPytorchAPIUsageStderr(f"from ctypes import CDLL; CDLL('{torch._C.__file__}')")
s = TestCase.runWithPytorchAPIUsageStderr(
f"from ctypes import CDLL; CDLL('{torch._C.__file__}')"
)
self.assertNotRegex(s, "PYTORCH_API_USAGE")
if __name__ == '__main__':
if __name__ == "__main__":
run_tests()