Skip to content

Commit dbc204b

Browse files
committed
FIx 403 Forbidden Failure
1 parent 83bfceb commit dbc204b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

sdks/python/apache_beam/runners/interactive/utils_test.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,10 @@ def test_child_module_logger_can_override_logging_level(self, mock_emit):
244244
reason='[interactive] dependency is not installed.')
245245
class ProgressIndicatorTest(unittest.TestCase):
246246
def setUp(self):
247-
with patch(
248-
'apache_beam.runners.interactive.cache_manager.CacheManager.cleanup'):
249-
ie.new_env()
247+
self.patcher = patch(
248+
'apache_beam.runners.interactive.cache_manager.CacheManager.cleanup')
249+
self.patcher.start()
250+
ie.new_env()
250251

251252
@patch('IPython.get_ipython', new_callable=mock_get_ipython)
252253
@patch(
@@ -281,6 +282,9 @@ def test_progress_in_HTML_JS_when_in_notebook(
281282
mocked_html.assert_called()
282283
mocked_js.assert_called()
283284

285+
def tearDown(self):
286+
self.patcher.stop()
287+
284288

285289
@unittest.skipIf(
286290
not ie.current_env().is_interactive_ready,
@@ -289,6 +293,9 @@ class MessagingUtilTest(unittest.TestCase):
289293
SAMPLE_DATA = {'a': [1, 2, 3], 'b': 4, 'c': '5', 'd': {'e': 'f'}}
290294

291295
def setUp(self):
296+
self.patcher = patch(
297+
'apache_beam.runners.interactive.cache_manager.CacheManager.cleanup')
298+
self.patcher.start()
292299
ie.new_env()
293300

294301
def test_as_json_decorator(self):
@@ -300,6 +307,9 @@ def dummy():
300307
# dictionaries remember the order of items inserted.
301308
self.assertEqual(json.loads(dummy()), MessagingUtilTest.SAMPLE_DATA)
302309

310+
def tearDown(self):
311+
self.patcher.stop()
312+
303313

304314
class GeneralUtilTest(unittest.TestCase):
305315
def test_pcoll_by_name(self):

0 commit comments

Comments
 (0)