File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ Getting Started
2222
2323.. invisible-code-block: python
2424
25+ import contextlib
2526 import pathlib
2627 import shutil
2728
@@ -37,7 +38,8 @@ Getting Started
3738 client_secret_key='[client-secret-key]',
3839 )
3940 mock.add_database(database=database)
40- mock.__enter__()
41+ stack = contextlib.ExitStack()
42+ stack.enter_context(mock)
4143
4244 # We rely on implementation details of the fixtures package.
4345 image = pathlib.Path(vws_test_fixtures.__path__[0]) / 'high_quality_image.jpg'
@@ -84,7 +86,7 @@ Getting Started
8486.. invisible-code-block: python
8587 new_image = pathlib.Path('high_quality_image.jpg')
8688 new_image.unlink()
87- mock.__exit__ ()
89+ stack.close ()
8890
8991 Full Documentation
9092------------------
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ See the :doc:`api-reference` for full usage details.
1818
1919.. invisible-code-block: python
2020
21+ import contextlib
2122 import pathlib
2223 import shutil
2324
@@ -33,7 +34,8 @@ See the :doc:`api-reference` for full usage details.
3334 client_secret_key='[client-secret-key]',
3435 )
3536 mock.add_database(database=database)
36- mock.__enter__()
37+ stack = contextlib.ExitStack()
38+ stack.enter_context(mock)
3739
3840 # We rely on implementation details of the fixtures package.
3941 image = pathlib.Path(vws_test_fixtures.__path__[0]) / 'high_quality_image.jpg'
@@ -81,7 +83,7 @@ See the :doc:`api-reference` for full usage details.
8183
8284 new_image = pathlib.Path('high_quality_image.jpg')
8385 new_image.unlink()
84- mock.__exit__ ()
86+ stack.close ()
8587
8688 Testing
8789-------
You can’t perform that action at this time.
0 commit comments