Skip to content

Commit 9c0b9b3

Browse files
committed
test: pin empty ACTOR_BUILD_TAGS to the unset behavior
1 parent 9c227b0 commit 9c0b9b3

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

tests/unit/actor/test_actor_env_helpers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,10 @@ async def test_get_env_with_randomized_env_vars(monkeypatch: pytest.MonkeyPatch,
166166

167167
list_get_env_var = list_env_var.name.lower()
168168
expected_value_count = random.randint(0, len(available_values))
169-
expected_get_env[list_get_env_var] = random.sample(available_values, expected_value_count)
170-
monkeypatch.setenv(list_env_var, ','.join(expected_get_env[list_get_env_var]))
169+
expected_values = random.sample(available_values, expected_value_count)
170+
monkeypatch.setenv(list_env_var, ','.join(expected_values))
171+
# An env var exported as an empty string counts as unset, same as a missing one.
172+
expected_get_env[list_get_env_var] = expected_values or None
171173

172174
# Test behavior with missing env var in case of empty list
173175
if expected_value_count == 0 and random.random() < 0.5:

tests/unit/actor/test_configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ def test_actor_storage_json_env_var(monkeypatch: pytest.MonkeyPatch) -> None:
410410
pytest.param('ACTOR_WEB_SERVER_PORT', 'web_server_port', 4321, id='web_server_port'),
411411
pytest.param('APIFY_CHARGED_ACTOR_EVENT_COUNTS', 'charged_event_counts', None, id='charged_event_counts'),
412412
pytest.param('ACTOR_INPUT_KEY', 'input_key', 'INPUT', id='input_key'),
413+
pytest.param('ACTOR_BUILD_TAGS', 'actor_build_tags', None, id='actor_build_tags'),
413414
pytest.param('CRAWLEE_PURGE_ON_START', 'purge_on_start', True, id='purge_on_start'),
414415
],
415416
)

0 commit comments

Comments
 (0)