Skip to content

Commit ccff023

Browse files
committed
PYTHON-1714 Add c extension use to client metadata
Fix tests - has_c is a func!
1 parent 473578a commit ccff023

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/asynchronous/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ async def test_read_preference(self):
343343

344344
async def test_metadata(self):
345345
metadata = copy.deepcopy(_METADATA)
346-
if has_c:
346+
if has_c():
347347
metadata["driver"]["name"] = "PyMongo|c|async"
348348
else:
349349
metadata["driver"]["name"] = "PyMongo|async"
@@ -369,7 +369,7 @@ async def test_metadata(self):
369369
with self.assertRaises(TypeError):
370370
self.simple_client(driver=("Foo", "1", "a"))
371371
# Test appending to driver info.
372-
if has_c:
372+
if has_c():
373373
metadata["driver"]["name"] = "PyMongo|c|async|FooDriver"
374374
else:
375375
metadata["driver"]["name"] = "PyMongo|async|FooDriver"
@@ -1933,7 +1933,7 @@ def test_sigstop_sigcont(self):
19331933
async def _test_handshake(self, env_vars, expected_env):
19341934
with patch.dict("os.environ", env_vars):
19351935
metadata = copy.deepcopy(_METADATA)
1936-
if has_c:
1936+
if has_c():
19371937
metadata["driver"]["name"] = "PyMongo|c|async"
19381938
else:
19391939
metadata["driver"]["name"] = "PyMongo|async"

test/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def test_read_preference(self):
335335

336336
def test_metadata(self):
337337
metadata = copy.deepcopy(_METADATA)
338-
if has_c:
338+
if has_c():
339339
metadata["driver"]["name"] = "PyMongo|c"
340340
else:
341341
metadata["driver"]["name"] = "PyMongo"
@@ -361,7 +361,7 @@ def test_metadata(self):
361361
with self.assertRaises(TypeError):
362362
self.simple_client(driver=("Foo", "1", "a"))
363363
# Test appending to driver info.
364-
if has_c:
364+
if has_c():
365365
metadata["driver"]["name"] = "PyMongo|c|FooDriver"
366366
else:
367367
metadata["driver"]["name"] = "PyMongo|FooDriver"
@@ -1891,7 +1891,7 @@ def test_sigstop_sigcont(self):
18911891
def _test_handshake(self, env_vars, expected_env):
18921892
with patch.dict("os.environ", env_vars):
18931893
metadata = copy.deepcopy(_METADATA)
1894-
if has_c:
1894+
if has_c():
18951895
metadata["driver"]["name"] = "PyMongo|c"
18961896
else:
18971897
metadata["driver"]["name"] = "PyMongo"

0 commit comments

Comments
 (0)