@@ -181,7 +181,7 @@ def wrapper(foo):
181181 def second_wrapper (foo , bar ):
182182 return wrapper (foo ) + bar
183183
184- assert second_wrapper .__wrapped__ is a
184+ assert second_wrapper .__wrapped__ is wrapper
185185 assert "bar" in inspect .signature (second_wrapper ).parameters
186186 assert second_wrapper (1 , - 1 ) == 0
187187
@@ -254,20 +254,23 @@ def test_issue_77_async_generator_partial():
254254 assert asyncio .get_event_loop ().run_until_complete (asyncio .ensure_future (f_partial ().__anext__ ())) == 1
255255
256256
257+
258+ @pytest .mark .skipif (sys .version_info < (3 , 3 ), reason = "Tests PEP 367 behavior, which was introduced in python 3.3." )
257259def test_issue_85_wrapped_forwardref_annotation ():
258260 import typing
259261 from . import issue_85_module
260262
261263 @wraps (issue_85_module .forwardref_method , remove_args = ["bar" ])
262- def decorated (* args , ** kwargs ):
263- return issue_85_module .forwardref_method (* args , ** kwargs , bar = "x" )
264+ def wrapper (** kwargs ):
265+ kwargs ["bar" ] = "x" # python 2 syntax to prevent syntax error.
266+ return issue_85_module .forwardref_method (** kwargs )
264267
265268 # Make sure the wrapper function works as expected
266- assert decorated (issue_85_module .ForwardRef ()) == "defaultx"
269+ assert wrapper (issue_85_module .ForwardRef ()). x == "defaultx"
267270
268271 # Check that the type hints of the wrapper are ok with the forward reference correctly resolved
269272 expected_annotations = {
270273 "foo" : issue_85_module .ForwardRef ,
271274 "return" : issue_85_module .ForwardRef ,
272275 }
273- assert typing .get_type_hints (decorated ) == expected_annotations
276+ assert typing .get_type_hints (wrapper ) == expected_annotations
0 commit comments