Skip to content

Commit

Permalink
Remove deprecated use of random.sample on sets
Browse files Browse the repository at this point in the history
  • Loading branch information
agates committed Jun 19, 2022
1 parent 49a1d0f commit 0f9759a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/integration/test_write_cli_multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ async def test_write_cli_multiple():
for i in range(num_iris)
}

medium = str_medium_map[random.sample(mediums, 1)[0]]
reason = str_reason_map[random.sample(reasons, 1)[0]]
medium = str_medium_map[random.sample(sorted(mediums), 1)[0]]
reason = str_reason_map[random.sample(sorted(reasons), 1)[0]]

default_hive_operation_id = HiveOperationId(LIVETEST_OPERATION_ID, medium, reason)
default_hive_operation_id_str = str(default_hive_operation_id)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_write_cli_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ async def test_write_cli_single():
test_name = "cli_single"
iri = f"https://example.com?t={test_name}&v={pv()}&s={session_uuid_str}"

medium = str_medium_map[random.sample(mediums, 1)[0]]
reason = str_reason_map[random.sample(reasons, 1)[0]]
medium = str_medium_map[random.sample(sorted(mediums), 1)[0]]
reason = str_reason_map[random.sample(sorted(reasons), 1)[0]]

default_hive_operation_id = HiveOperationId(LIVETEST_OPERATION_ID, medium, reason)
default_hive_operation_id_str = str(default_hive_operation_id)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_write_cli_single_simulcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ async def get_iri_from_blockchain(start_block: int):
for n in range(7)
}
for iri in test_iris:
medium = str_medium_map[random.sample(mediums, 1)[0]]
reason = str_reason_map[random.sample(reasons, 1)[0]]
medium = str_medium_map[random.sample(sorted(mediums), 1)[0]]
reason = str_reason_map[random.sample(sorted(reasons), 1)[0]]
args = [
"--medium",
str(medium),
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_write_zmq_multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ async def test_write_zmq_multiple(event_loop):
for i in range(num_iris)
}

medium = str_medium_map[random.sample(mediums, 1)[0]]
reason = str_reason_map[random.sample(reasons, 1)[0]]
medium = str_medium_map[random.sample(sorted(mediums), 1)[0]]
reason = str_reason_map[random.sample(sorted(reasons), 1)[0]]

default_hive_operation_id = HiveOperationId(LIVETEST_OPERATION_ID, medium, reason)
default_hive_operation_id_str = str(default_hive_operation_id)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_write_zmq_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ async def test_write_zmq_single(event_loop):
test_name = "zmq_single"
iri = f"https://example.com?t={test_name}&v={pv()}&s={session_uuid_str}"

medium = str_medium_map[random.sample(mediums, 1)[0]]
reason = str_reason_map[random.sample(reasons, 1)[0]]
medium = str_medium_map[random.sample(sorted(mediums), 1)[0]]
reason = str_reason_map[random.sample(sorted(reasons), 1)[0]]

default_hive_operation_id = HiveOperationId(LIVETEST_OPERATION_ID, medium, reason)
default_hive_operation_id_str = str(default_hive_operation_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def mock_broadcast(*args, **kwargs):
test_name = "failure_retry_handles_invalid_error_response"
iri = f"https://example.com?t={test_name}&v={pv()}&s={session_uuid_str}"

medium = str_medium_map[random.sample(mediums, 1)[0]]
reason = str_reason_map[random.sample(reasons, 1)[0]]
medium = str_medium_map[random.sample(sorted(mediums), 1)[0]]
reason = str_reason_map[random.sample(sorted(reasons), 1)[0]]

host = "127.0.0.1"
port = 9979
Expand Down

0 comments on commit 0f9759a

Please sign in to comment.