Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .evergreen/scripts/resync_all_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def resync_specs(directory: pathlib.Path, errored: dict[str, str]) -> None:
if not spec.is_dir():
continue

if spec.name in ["asynchronous"]:
if spec.name == "asynchronous":
continue
try:
subprocess.run( # noqa: S603
Expand Down
2 changes: 1 addition & 1 deletion pymongo/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def validate_auth_mechanism_properties(option: str, value: Any) -> dict[str, boo
props[key] = prop_value
elif isinstance(prop_value, bool):
props[key] = str(prop_value).lower()
elif key in ["ALLOWED_HOSTS"] and isinstance(prop_value, list):
elif key == "ALLOWED_HOSTS" and isinstance(prop_value, list):
props[key] = prop_value
elif key in ["OIDC_CALLBACK", "OIDC_HUMAN_CALLBACK"]:
from pymongo.auth_oidc_shared import OIDCCallback
Expand Down
2 changes: 1 addition & 1 deletion pymongo/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def details(self) -> Mapping[str, Any] | None:

@property
def timeout(self) -> bool:
return self.__code in (50,)
return self.__code == 50

@property
def _base_backoff_ms(self) -> float | None:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ extend-select = [
"ASYNC", # flake8-async
"TC", # flake8-type-checking
"PERF", # perflint
"FURB", # refurb
# Non-design pylint rules.
"PLR0124", # pylint: comparison of a name with itself
"PLR0133", # pylint: comparison between two constants
Expand Down
2 changes: 1 addition & 1 deletion test/asynchronous/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ async def asyncSetUp(self) -> None:
self.mongos_clients.append(await self.async_single_client("{}:{}".format(*address)))

async def set_fail_point(self, command_args):
clients = self.mongos_clients if self.mongos_clients else [self.client]
clients = self.mongos_clients or [self.client]
for client in clients:
await self.configure_fail_point(client, command_args)

Expand Down
2 changes: 1 addition & 1 deletion test/asynchronous/unified_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ async def _databaseOperation_assertCollectionExists(self, target, **kwargs):
async def kill_all_sessions(self):
if getattr(self, "client", None) is None:
return
clients = self.mongos_clients if self.mongos_clients else [self.client]
clients = self.mongos_clients or [self.client]
for client in clients:
try:
await client.admin.command("killAllSessions", [])
Expand Down
2 changes: 1 addition & 1 deletion test/test_bson_binary_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def run_test(self):
self.assertEqual(
vector_obs.dtype, BinaryVectorDtype[dtype_alias_exp], description
)
if dtype_exp in [BinaryVectorDtype.FLOAT32]:
if dtype_exp == BinaryVectorDtype.FLOAT32:
[
self.assertAlmostEqual(vector_obs.data[i], vector_exp[i], delta=1e-5)
for i in range(len(vector_exp))
Expand Down
2 changes: 1 addition & 1 deletion test/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def setUp(self) -> None:
self.mongos_clients.append(self.single_client("{}:{}".format(*address)))

def set_fail_point(self, command_args):
clients = self.mongos_clients if self.mongos_clients else [self.client]
clients = self.mongos_clients or [self.client]
for client in clients:
self.configure_fail_point(client, command_args)

Expand Down
2 changes: 1 addition & 1 deletion test/unified_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ def _databaseOperation_assertCollectionExists(self, target, **kwargs):
def kill_all_sessions(self):
if getattr(self, "client", None) is None:
return
clients = self.mongos_clients if self.mongos_clients else [self.client]
clients = self.mongos_clients or [self.client]
for client in clients:
try:
client.admin.command("killAllSessions", [])
Expand Down
Loading