@@ -202,13 +202,11 @@ def old_func(*args, **kwargs):
202202 old_func (1 , 2 )
203203
204204 with pytest .raises (AssertionError , match = 'deadline should match vX.Y' ):
205- # pylint: disable=unused-variable
205+
206206 @deprecated (deadline = 'invalid' , fix = 'Roll some dice.' )
207207 def badly_deprecated_func (* args , ** kwargs ): # pragma: no cover
208208 return new_func (* args , ** kwargs )
209209
210- # pylint: enable=unused-variable
211-
212210
213211def test_deprecated_parameter ():
214212 @deprecated_parameter (
@@ -234,20 +232,16 @@ def f(new_count):
234232 'Double it yourself.' ,
235233 deadline = 'v1.2' ,
236234 ):
237- # pylint: disable=unexpected-keyword-arg
238235 # pylint: disable=no-value-for-parameter
239236 assert f (double_count = 1 ) == 2
240237 # pylint: enable=no-value-for-parameter
241- # pylint: enable=unexpected-keyword-arg
242238
243239 with pytest .raises (
244240 ValueError , match = 'During testing using Cirq deprecated functionality is not allowed'
245241 ):
246- # pylint: disable=unexpected-keyword-arg
247242 # pylint: disable=no-value-for-parameter
248243 f (double_count = 1 )
249244 # pylint: enable=no-value-for-parameter
250- # pylint: enable=unexpected-keyword-arg
251245
252246 with pytest .raises (AssertionError , match = 'deadline should match vX.Y' ):
253247
@@ -259,12 +253,9 @@ def f(new_count):
259253 match = lambda args , kwargs : 'double_count' in kwargs ,
260254 rewrite = lambda args , kwargs : (args , {'new_count' : kwargs ['double_count' ] * 2 }),
261255 )
262- # pylint: disable=unused-variable
263256 def f_with_badly_deprecated_param (new_count ): # pragma: no cover
264257 return new_count
265258
266- # pylint: enable=unused-variable
267-
268259
269260@duet .sync
270261async def test_deprecated_parameter_async_function ():
@@ -293,11 +284,9 @@ async def f(new_count):
293284 'Double it yourself.' ,
294285 deadline = 'v1.2' ,
295286 ):
296- # pylint: disable=unexpected-keyword-arg
297287 # pylint: disable=no-value-for-parameter
298288 assert await f (double_count = 1 ) == 2
299289 # pylint: enable=no-value-for-parameter
300- # pylint: enable=unexpected-keyword-arg
301290
302291
303292def test_wrap_module ():
@@ -587,7 +576,6 @@ def _repeated_import_path():
587576
588577def _type_repr_in_deprecated_module ():
589578 # initialize the DeprecatedModuleFinders
590- # pylint: disable=unused-import
591579 import cirq .testing ._compat_test_data .fake_a as mod_a
592580
593581 expected_repr = "<class 'cirq.testing._compat_test_data.module_a.types.SampleType'>"
@@ -763,8 +751,6 @@ def test_metadata_search_path():
763751
764752def _test_metadata_search_path_inner (): # pragma: no cover
765753 # initialize the DeprecatedModuleFinders
766- # pylint: disable=unused-import
767-
768754 assert importlib .metadata .metadata ('numpy' )
769755
770756
@@ -805,7 +791,6 @@ def test_type_repr_in_new_module():
805791
806792def _test_type_repr_in_new_module_inner ():
807793 # initialize the DeprecatedModuleFinders
808- # pylint: disable=unused-import
809794 import cirq .testing ._compat_test_data .module_a as mod_a
810795
811796 expected_repr = "<class 'cirq.testing._compat_test_data.module_a.types.SampleType'>"
@@ -875,7 +860,6 @@ def test_new_module_is_top_level():
875860
876861def _test_new_module_is_top_level_inner ():
877862 # sets up the DeprecationFinders
878- # pylint: disable=unused-import
879863 import time
880864
881865 # imports a top level module that was also deprecated
0 commit comments