Skip to content

Commit eb93fbd

Browse files
committed
chore: fix tests
1 parent d98b26c commit eb93fbd

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ exclude = [
118118
[[tool.mypy.overrides]]
119119
module = "tests.*"
120120
strict_optional = false
121+
# Generic classes (Replane, InMemoryReplaneClient) don't require type parameters in tests
122+
disable_error_code = ["var-annotated"]
121123

122124
[tool.pytest.ini_options]
123125
testpaths = "tests/"

tests/test_sync_client.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,33 +1658,31 @@ def test_per_request_context_overrides_replane_client_id(self, mock_server: Mock
16581658

16591659
def test_unique_replane_client_id_per_client_instance(self, mock_server: MockSSEServer):
16601660
"""Each client instance gets a unique replaneClientId."""
1661-
mock_server.send_init(
1662-
[
1663-
create_config(
1664-
"feature",
1665-
"default",
1666-
overrides=[
1667-
create_override(
1668-
"50-percent-rollout",
1669-
"rollout-value",
1670-
[
1671-
{
1672-
"operator": "segmentation",
1673-
"property": "replaneClientId",
1674-
"fromPercentage": 0,
1675-
"toPercentage": 50,
1676-
"seed": "test-seed",
1677-
}
1678-
],
1679-
),
1661+
config = create_config(
1662+
"feature",
1663+
"default",
1664+
overrides=[
1665+
create_override(
1666+
"50-percent-rollout",
1667+
"rollout-value",
1668+
[
1669+
{
1670+
"operator": "segmentation",
1671+
"property": "replaneClientId",
1672+
"fromPercentage": 0,
1673+
"toPercentage": 50,
1674+
"seed": "test-seed",
1675+
}
16801676
],
16811677
),
1682-
]
1678+
],
16831679
)
16841680

16851681
# Create multiple clients and check they get different segmentation results
16861682
results = []
16871683
for _ in range(10):
1684+
# Each client connection needs its own init event
1685+
mock_server.send_init([config])
16881686
with Replane(
16891687
base_url=mock_server.url,
16901688
sdk_key="rp_test_key",

0 commit comments

Comments
 (0)