mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
committed by
PyTorch MergeBot
parent
a5c93a6899
commit
01fb9676b8
@ -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()
|
||||
|
Reference in New Issue
Block a user