KevinGG commented on a change in pull request #13881:
URL: https://github.com/apache/beam/pull/13881#discussion_r569649930



##########
File path: 
sdks/python/apache_beam/runners/interactive/interactive_environment_test.py
##########
@@ -168,20 +168,18 @@ def 
test_pipeline_result_is_none_when_pipeline_absent(self):
     self.assertIs(ie.current_env().is_terminated(self._p), True)
     self.assertIs(ie.current_env().evict_pipeline_result(self._p), None)
 
-  @patch('atexit.register')
-  def test_cleanup_registered_when_creating_new_env(self, mocked_atexit):
-    ie.new_env()
-    mocked_atexit.assert_called_once()
+  def test_cleanup_registered_when_creating_new_env(self):
+    with patch('atexit.register') as mocked_atexit:
+      a_new_env = ie.InteractiveEnvironment()

Review comment:
       With this change, the test does not test around the global state. 
Instead, it tests the constructor directly.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to