77import io
88import secrets
99import uuid
10- from typing import IO
10+ from typing import BinaryIO
1111
1212import pytest
1313from freezegun import freeze_time
@@ -37,7 +37,7 @@ class TestAddTarget:
3737 @pytest .mark .parametrize (argnames = "active_flag" , argvalues = [True , False ])
3838 def test_add_target (
3939 vws_client : VWS ,
40- image : IO [ bytes ] ,
40+ image : io . BytesIO | BinaryIO ,
4141 application_metadata : bytes | None ,
4242 cloud_reco_client : CloudRecoService ,
4343 * ,
@@ -81,7 +81,7 @@ def test_add_target(
8181 @staticmethod
8282 def test_add_two_targets (
8383 vws_client : VWS ,
84- image : IO [ bytes ] ,
84+ image : io . BytesIO | BinaryIO ,
8585 ) -> None :
8686 """No exception is raised when adding two targets with different names.
8787
@@ -103,7 +103,7 @@ class TestCustomBaseVWSURL:
103103 """
104104
105105 @staticmethod
106- def test_custom_base_url (image : IO [ bytes ] ) -> None :
106+ def test_custom_base_url (image : io . BytesIO | BinaryIO ) -> None :
107107 """
108108 It is possible to use add a target to a database under a custom VWS
109109 URL.
@@ -135,7 +135,7 @@ class TestListTargets:
135135 @staticmethod
136136 def test_list_targets (
137137 vws_client : VWS ,
138- image : IO [ bytes ] ,
138+ image : io . BytesIO | BinaryIO ,
139139 ) -> None :
140140 """
141141 It is possible to get a list of target IDs.
@@ -165,7 +165,7 @@ class TestDelete:
165165 @staticmethod
166166 def test_delete_target (
167167 vws_client : VWS ,
168- image : IO [ bytes ] ,
168+ image : io . BytesIO | BinaryIO ,
169169 ) -> None :
170170 """
171171 It is possible to delete a target.
@@ -192,7 +192,7 @@ class TestGetTargetSummaryReport:
192192 @staticmethod
193193 def test_get_target_summary_report (
194194 vws_client : VWS ,
195- image : IO [ bytes ] ,
195+ image : io . BytesIO | BinaryIO ,
196196 ) -> None :
197197 """
198198 Details of a target are returned by ``get_target_summary_report``.
@@ -294,7 +294,7 @@ class TestGetTargetRecord:
294294 @staticmethod
295295 def test_get_target_record (
296296 vws_client : VWS ,
297- image : IO [ bytes ] ,
297+ image : io . BytesIO | BinaryIO ,
298298 ) -> None :
299299 """
300300 Details of a target are returned by ``get_target_record``.
@@ -369,7 +369,7 @@ class TestWaitForTargetProcessed:
369369 @staticmethod
370370 def test_wait_for_target_processed (
371371 vws_client : VWS ,
372- image : IO [ bytes ] ,
372+ image : io . BytesIO | BinaryIO ,
373373 ) -> None :
374374 """
375375 It is possible to wait until a target is processed.
@@ -389,7 +389,7 @@ def test_wait_for_target_processed(
389389
390390 @staticmethod
391391 def test_default_seconds_between_requests (
392- image : IO [ bytes ] ,
392+ image : io . BytesIO | BinaryIO ,
393393 ) -> None :
394394 """
395395 By default, 0.2 seconds are waited between polling requests.
@@ -441,7 +441,7 @@ def test_default_seconds_between_requests(
441441
442442 @staticmethod
443443 def test_custom_seconds_between_requests (
444- image : IO [ bytes ] ,
444+ image : io . BytesIO | BinaryIO ,
445445 ) -> None :
446446 """
447447 It is possible to customize the time waited between polling requests.
@@ -492,7 +492,7 @@ def test_custom_seconds_between_requests(
492492 assert report .request_usage == expected_requests
493493
494494 @staticmethod
495- def test_custom_timeout (image : IO [ bytes ] ) -> None :
495+ def test_custom_timeout (image : io . BytesIO | BinaryIO ) -> None :
496496 """
497497 It is possible to set a maximum timeout.
498498 """
@@ -538,7 +538,7 @@ class TestGetDuplicateTargets:
538538 @staticmethod
539539 def test_get_duplicate_targets (
540540 vws_client : VWS ,
541- image : IO [ bytes ] ,
541+ image : io . BytesIO | BinaryIO ,
542542 ) -> None :
543543 """
544544 It is possible to get the IDs of similar targets.
@@ -572,7 +572,7 @@ class TestUpdateTarget:
572572 @staticmethod
573573 def test_update_target (
574574 vws_client : VWS ,
575- image : IO [ bytes ] ,
575+ image : io . BytesIO | BinaryIO ,
576576 different_high_quality_image : io .BytesIO ,
577577 cloud_reco_client : CloudRecoService ,
578578 ) -> None :
@@ -633,7 +633,7 @@ def test_update_target(
633633 @staticmethod
634634 def test_no_fields_given (
635635 vws_client : VWS ,
636- image : IO [ bytes ] ,
636+ image : io . BytesIO | BinaryIO ,
637637 ) -> None :
638638 """
639639 It is possible to give no update fields.
0 commit comments