@@ -52,7 +52,7 @@ async def download_file(
52
52
53
53
# Mock download_file so we don't actually try to download files.
54
54
mcs = get_content_scanner ()
55
- mcs .file_downloader .download_file = self .downloader_mock # type: ignore[assignment ]
55
+ mcs .file_downloader .download_file = self .downloader_mock # type: ignore[method-assign ]
56
56
self .scanner = mcs .scanner
57
57
58
58
async def test_scan (self ) -> None :
@@ -161,7 +161,7 @@ async def test_cache_max_size_mismatching_hash(self) -> None:
161
161
"""
162
162
# Mock the _run_scan command so we can keep track of its call count.
163
163
mock_runner = Mock (return_value = 0 )
164
- self .scanner ._run_scan = mock_runner # type: ignore[assignment ]
164
+ self .scanner ._run_scan = mock_runner # type: ignore[method-assign ]
165
165
166
166
# Calculate the cache key for this file so we can look it up later.
167
167
cache_key = self .scanner ._get_cache_key_for_file (MEDIA_PATH , None , None )
@@ -269,7 +269,7 @@ async def test_dont_cache_exit_codes(self) -> None:
269
269
# It's tricky to give a value to `scanner._script` that makes `_run_scan` return 5
270
270
# directly, so we just mock it here.
271
271
run_scan_mock = Mock (return_value = 5 )
272
- self .scanner ._run_scan = run_scan_mock # type: ignore[assignment ]
272
+ self .scanner ._run_scan = run_scan_mock # type: ignore[method-assign ]
273
273
274
274
# Scan the file, we'll check later that it wasn't cached.
275
275
with self .assertRaises (FileDirtyError ):
@@ -318,7 +318,7 @@ async def _scan_file(*args: Any) -> MediaDescription:
318
318
return self .downloader_res
319
319
320
320
scan_mock = Mock (side_effect = _scan_file )
321
- self .scanner ._scan_file = scan_mock # type: ignore[assignment ]
321
+ self .scanner ._scan_file = scan_mock # type: ignore[method-assign ]
322
322
323
323
# Request two scans of the same file at the same time.
324
324
results = await asyncio .gather (
0 commit comments