From 5610e7be33d9ec39016332a2d554fe65ed6ac66d Mon Sep 17 00:00:00 2001 From: Marius Ciepluch <11855163+norandom@users.noreply.github.com> Date: Fri, 20 Nov 2026 20:08:21 +0100 Subject: [PATCH] fix(valid-detection-benchmark): collapse nested precondition guard ifs Ruff SIM102: combine the IfMatch precondition check into one condition; behavior unchanged. --- tests/test_valid_benchmark_custody_store.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_valid_benchmark_custody_store.py b/tests/test_valid_benchmark_custody_store.py index c53cca32..d1f95d2a 100644 --- a/tests/test_valid_benchmark_custody_store.py +++ b/tests/test_valid_benchmark_custody_store.py @@ -67,9 +67,8 @@ class _Client: if kwargs.get("IfNoneMatch") == "*" and current is not None and not self.ignore_if_none_match: raise _ProviderError("PreconditionFailed") expected = kwargs.get("IfMatch") - if expected is not None and not self.allow_two_winners: - if current is None or current.etag != expected: - raise _ProviderError("PreconditionFailed") + if expected is not None and not self.allow_two_winners and (current is None or current.etag != expected): + raise _ProviderError("PreconditionFailed") version_id = self.fixed_version_id or f"version-{self._next_version}" self._next_version += 1 etag = sha256(body + version_id.encode()).hexdigest()