@@ -31,34 +31,15 @@ async def test_actor_is_not_at_home_when_local() -> None:
31
31
assert is_at_home is False
32
32
33
33
34
- async def test_get_env_with_randomized_env_vars (monkeypatch : pytest .MonkeyPatch ) -> None : # noqa: PLR0912
34
+ async def test_get_env_with_randomized_env_vars (monkeypatch : pytest .MonkeyPatch ) -> None :
35
35
ignored_env_vars = {
36
- ApifyEnvVars .INPUT_KEY ,
37
- ApifyEnvVars .MEMORY_MBYTES ,
38
- ApifyEnvVars .STARTED_AT ,
39
- ApifyEnvVars .TIMEOUT_AT ,
40
- ApifyEnvVars .DEFAULT_DATASET_ID ,
41
- ApifyEnvVars .DEFAULT_KEY_VALUE_STORE_ID ,
42
- ApifyEnvVars .DEFAULT_REQUEST_QUEUE_ID ,
43
36
ApifyEnvVars .SDK_LATEST_VERSION ,
44
37
ApifyEnvVars .LOG_FORMAT ,
45
38
ApifyEnvVars .LOG_LEVEL ,
46
39
ActorEnvVars .STANDBY_PORT ,
47
40
ApifyEnvVars .PERSIST_STORAGE ,
48
41
}
49
42
50
- legacy_env_vars = {
51
- ApifyEnvVars .ACT_ID : ActorEnvVars .ID ,
52
- ApifyEnvVars .ACT_RUN_ID : ActorEnvVars .RUN_ID ,
53
- ApifyEnvVars .ACTOR_ID : ActorEnvVars .ID ,
54
- ApifyEnvVars .ACTOR_BUILD_ID : ActorEnvVars .BUILD_ID ,
55
- ApifyEnvVars .ACTOR_BUILD_NUMBER : ActorEnvVars .BUILD_NUMBER ,
56
- ApifyEnvVars .ACTOR_RUN_ID : ActorEnvVars .RUN_ID ,
57
- ApifyEnvVars .ACTOR_TASK_ID : ActorEnvVars .TASK_ID ,
58
- ApifyEnvVars .CONTAINER_URL : ActorEnvVars .WEB_SERVER_URL ,
59
- ApifyEnvVars .CONTAINER_PORT : ActorEnvVars .WEB_SERVER_PORT ,
60
- }
61
-
62
43
# Set up random env vars
63
44
expected_get_env = dict [str , Any ]()
64
45
expected_get_env [ApifyEnvVars .LOG_LEVEL .name .lower ()] = 'INFO'
@@ -134,9 +115,7 @@ async def test_get_env_with_randomized_env_vars(monkeypatch: pytest.MonkeyPatch)
134
115
135
116
# We need this override so that the actor doesn't fail when connecting to the platform events websocket
136
117
monkeypatch .delenv (ActorEnvVars .EVENTS_WEBSOCKET_URL )
137
- monkeypatch .delenv (ApifyEnvVars .ACTOR_EVENTS_WS_URL )
138
118
expected_get_env [ActorEnvVars .EVENTS_WEBSOCKET_URL .name .lower ()] = None
139
- expected_get_env [ApifyEnvVars .ACTOR_EVENTS_WS_URL .name .lower ()] = None
140
119
141
120
# Adjust expectations for timedelta fields
142
121
for env_name , env_value in expected_get_env .items ():
@@ -148,10 +127,6 @@ async def test_get_env_with_randomized_env_vars(monkeypatch: pytest.MonkeyPatch)
148
127
expected_get_env [ApifyEnvVars .DEDICATED_CPUS .name .lower ()]
149
128
)
150
129
151
- # Update expectations for legacy configuration
152
- for old_name , new_name in legacy_env_vars .items ():
153
- expected_get_env [old_name .name .lower ()] = expected_get_env [new_name .name .lower ()]
154
-
155
130
await Actor .init ()
156
131
assert Actor .get_env () == expected_get_env
157
132
0 commit comments