Enable typechecking for testing.py (#112129)
Summary:
X-link: https://github.com/pytorch/pytorch/pull/112129
Approved by: https://github.com/Skylion007
ghstack dependencies: #111894, #111992, #112031, #112127, #112128
Reviewed By: izaitsevfb
Differential Revision: D50778824
Pulled By: int3
fbshipit-source-id: 53402a367156939d24a823d62eedb5a31846bba8