11import sys
2+ from typing import Union
23
34import databento as db
45import pytest
56import requests
67from databento .common .enums import Dataset , FeedMode , Schema
8+ from pytest_mock import MockerFixture
79
810
911class TestHistoricalMetadata :
@@ -12,7 +14,9 @@ def setup(self) -> None:
1214 self .client = db .Historical (key = key )
1315
1416 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
15- def test_list_publishers_sends_expected_request (self , mocker ) -> None :
17+ def test_list_publishers_sends_expected_request (
18+ self , mocker : MockerFixture
19+ ) -> None :
1620 # Arrange
1721 mocked_get = mocker .patch ("requests.get" )
1822
@@ -34,7 +38,7 @@ def test_list_publishers_sends_expected_request(self, mocker) -> None:
3438 assert isinstance (call ["auth" ], requests .auth .HTTPBasicAuth )
3539
3640 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
37- def test_list_datasets_sends_expected_request (self , mocker ) -> None :
41+ def test_list_datasets_sends_expected_request (self , mocker : MockerFixture ) -> None :
3842 # Arrange
3943 mocked_get = mocker .patch ("requests.get" )
4044
@@ -61,7 +65,7 @@ def test_list_datasets_sends_expected_request(self, mocker) -> None:
6165 assert isinstance (call ["auth" ], requests .auth .HTTPBasicAuth )
6266
6367 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
64- def test_list_schemas_sends_expected_request (self , mocker ) -> None :
68+ def test_list_schemas_sends_expected_request (self , mocker : MockerFixture ) -> None :
6569 # Arrange
6670 mocked_get = mocker .patch ("requests.get" )
6771
@@ -89,7 +93,7 @@ def test_list_schemas_sends_expected_request(self, mocker) -> None:
8993 assert isinstance (call ["auth" ], requests .auth .HTTPBasicAuth )
9094
9195 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
92- def test_list_fields_sends_expected_request (self , mocker ) -> None :
96+ def test_list_fields_sends_expected_request (self , mocker : MockerFixture ) -> None :
9397 # Arrange
9498 mocked_get = mocker .patch ("requests.get" )
9599
@@ -117,7 +121,7 @@ def test_list_fields_sends_expected_request(self, mocker) -> None:
117121 assert isinstance (call ["auth" ], requests .auth .HTTPBasicAuth )
118122
119123 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
120- def test_list_encodings_sends_expected_request (self , mocker ) -> None :
124+ def test_list_encodings_sends_expected_request (self , mocker : MockerFixture ) -> None :
121125 # Arrange
122126 mocked_get = mocker .patch ("requests.get" )
123127
@@ -139,7 +143,9 @@ def test_list_encodings_sends_expected_request(self, mocker) -> None:
139143 assert isinstance (call ["auth" ], requests .auth .HTTPBasicAuth )
140144
141145 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
142- def test_list_compressions_sends_expected_request (self , mocker ) -> None :
146+ def test_list_compressions_sends_expected_request (
147+ self , mocker : MockerFixture
148+ ) -> None :
143149 # Arrange
144150 mocked_get = mocker .patch ("requests.get" )
145151
@@ -169,7 +175,11 @@ def test_list_compressions_sends_expected_request(self, mocker) -> None:
169175 ],
170176 )
171177 def test_list_unit_price_sends_expected_request (
172- self , dataset , schema , mode , mocker
178+ self ,
179+ dataset : Union [str , Dataset ],
180+ schema : Union [str , Schema ],
181+ mode : Union [str , FeedMode ],
182+ mocker : MockerFixture ,
173183 ) -> None :
174184 # Arrange
175185 mocked_get = mocker .patch ("requests.get" )
@@ -201,7 +211,7 @@ def test_list_unit_price_sends_expected_request(
201211 assert isinstance (call ["auth" ], requests .auth .HTTPBasicAuth )
202212
203213 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
204- def test_get_shape_sends_expected_request (self , mocker ) -> None :
214+ def test_get_shape_sends_expected_request (self , mocker : MockerFixture ) -> None :
205215 # Arrange
206216 mocked_get = mocker .patch ("requests.get" )
207217
@@ -240,7 +250,9 @@ def test_get_shape_sends_expected_request(self, mocker) -> None:
240250 assert isinstance (call ["auth" ], requests .auth .HTTPBasicAuth )
241251
242252 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
243- def test_get_billable_size_sends_expected_request (self , mocker ) -> None :
253+ def test_get_billable_size_sends_expected_request (
254+ self , mocker : MockerFixture
255+ ) -> None :
244256 # Arrange
245257 mocked_get = mocker .patch ("requests.get" )
246258
@@ -279,7 +291,7 @@ def test_get_billable_size_sends_expected_request(self, mocker) -> None:
279291 assert isinstance (call ["auth" ], requests .auth .HTTPBasicAuth )
280292
281293 @pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "incompatible mocking" )
282- def test_get_cost_sends_expected_request (self , mocker ) -> None :
294+ def test_get_cost_sends_expected_request (self , mocker : MockerFixture ) -> None :
283295 # Arrange
284296 mocked_get = mocker .patch ("requests.get" )
285297
0 commit comments