Skip to content

Commit 0ce0766

Browse files
committed
test: narrow user_data type before nested mutation to fix type check
1 parent af0df85 commit 0ce0766

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/unit/actor/test_request_list.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ async def test_request_list_open_from_url_with_user_data_and_multiple_urls(https
217217
assert request.user_data['nested'] == {'key': 'value'}
218218

219219
# Each request owns an independent copy; mutating one must not leak into the others.
220-
requests[0].user_data['nested']['key'] = 'mutated'
220+
nested = requests[0].user_data['nested']
221+
assert isinstance(nested, dict)
222+
nested['key'] = 'mutated'
221223
assert requests[1].user_data['nested'] == {'key': 'value'}
222224

223225

0 commit comments

Comments
 (0)