[fix] fix test_python_dispatch with pytest (#64574)
authorkshitij12345 <kshitijkalambarkar@gmail.com>
Mon, 13 Sep 2021 00:05:33 +0000 (17:05 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 13 Sep 2021 00:06:55 +0000 (17:06 -0700)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/62501

Another approach for fixing the same issue

Pull Request resolved: https://github.com/pytorch/pytorch/pull/64574

Reviewed By: ngimel

Differential Revision: D30867237

Pulled By: ezyang

fbshipit-source-id: c632a1e0b241effdc21ae929abe42fccec88aa24

test/test_python_dispatch.py

index cd09488..218c68f 100644 (file)
@@ -95,6 +95,7 @@ def capture_logs() -> Iterator[List[str]]:
     handler = LoggingTensorHandler(log_list)
     logger.addHandler(handler)
     logger.setLevel(logging.INFO)
+    logger.propagate = False
     try:
         yield log_list
     finally: