Skip to content

PYTHON-5371 - Pass repr(ServerDescription) to logging #2329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/asynchronous/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,7 @@ async def test_direct_connection(self):
with self.assertRaises(ConfigurationError):
AsyncMongoClient(["host1", "host2"], directConnection=True)

@unittest.skipIf(os.environ.get("DEBUG_LOG"), "Enabling debug logs breaks this test")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this test break? I’m concerned about this pattern since it makes it harder to debug the test if it gets skipped. Could we leave a ticket open to come back to this test and make it work in debug mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were planning to replace this test with something less hacky in the future anyway. I can investigate deeper as to why this is breaking if we're planning to keep this test around instead.

@unittest.skipIf("PyPy" in sys.version, "PYTHON-2927 fails often on PyPy")
async def test_continuous_network_errors(self):
def server_description_count():
Expand Down
1 change: 1 addition & 0 deletions test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,7 @@ def test_direct_connection(self):
with self.assertRaises(ConfigurationError):
MongoClient(["host1", "host2"], directConnection=True)

@unittest.skipIf(os.environ.get("DEBUG_LOG"), "Enabling debug logs breaks this test")
@unittest.skipIf("PyPy" in sys.version, "PYTHON-2927 fails often on PyPy")
def test_continuous_network_errors(self):
def server_description_count():
Expand Down
Loading