Skip to content

Commit 0fc60ba

Browse files
committed
only reset client context after primary_stepdown
1 parent 3c640e8 commit 0fc60ba

File tree

6 files changed

+4
-8
lines changed

6 files changed

+4
-8
lines changed

test/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,8 +1234,6 @@ def tearDown(self):
12341234

12351235

12361236
def setup():
1237-
global client_context
1238-
client_context = ClientContext()
12391237
client_context.init()
12401238
warnings.resetwarnings()
12411239
warnings.simplefilter("always")

test/asynchronous/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,8 +1252,6 @@ def tearDown(self):
12521252

12531253

12541254
async def async_setup():
1255-
global async_client_context
1256-
async_client_context = AsyncClientContext()
12571255
await async_client_context.init()
12581256
warnings.resetwarnings()
12591257
warnings.simplefilter("always")

test/asynchronous/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def event_loop_policy():
2424
return asyncio.get_event_loop_policy()
2525

2626

27-
@pytest_asyncio.fixture(scope="module", autouse=True)
27+
@pytest_asyncio.fixture(scope="session", autouse=True)
2828
async def test_setup_and_teardown():
2929
await async_setup()
3030
yield

test/asynchronous/test_connections_survive_primary_stepdown_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def _setup_class(cls):
6565
@classmethod
6666
async def _tearDown_class(cls):
6767
await cls.client.close()
68-
# await recreate_client_context()
68+
await recreate_client_context()
6969

7070
async def asyncSetUp(self):
7171
# Note that all ops use same write-concern as self.db (majority).

test/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def event_loop_policy():
2222
return asyncio.get_event_loop_policy()
2323

2424

25-
@pytest.fixture(scope="module", autouse=True)
25+
@pytest.fixture(scope="session", autouse=True)
2626
def test_setup_and_teardown():
2727
setup()
2828
yield

test/test_connections_survive_primary_stepdown_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _setup_class(cls):
6565
@classmethod
6666
def _tearDown_class(cls):
6767
cls.client.close()
68-
# recreate_client_context()
68+
recreate_client_context()
6969

7070
def setUp(self):
7171
# Note that all ops use same write-concern as self.db (majority).

0 commit comments

Comments
 (0)