pytorch
bccf8831 - Allow initializing TestCase() outside of unittest.main() (#39695)

Commit
4 years ago
Allow initializing TestCase() outside of unittest.main() (#39695) Summary: When debugging it is sometimes useful to call test code manually. This change makes that easier. Before this change, one would get the following error: ``` $ python -c "from torch.testing._internal.jit_utils import JitTestCase; JitTestCase()" Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/jansel/pytorch/torch/testing/_internal/common_utils.py", line 740, in __init__ test_method = getattr(self, method_name) AttributeError: 'JitTestCase' object has no attribute 'runTest' ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/39695 Test Plan: `python -c "from torch.testing._internal.jit_utils import JitTestCase; JitTestCase()"` Differential Revision: D21959249 Pulled By: jansel fbshipit-source-id: 8435249f102338c957c3a7a7aad48d21d372a8cf
Author
Parents
Loading