##// END OF EJS Templates
explict python version check
Matthias Bussonnier -
Show More
@@ -514,28 +514,20 b' def test_render_signature_long():'
514 signature(long_function),
514 signature(long_function),
515 long_function.__name__,
515 long_function.__name__,
516 )
516 )
517 assert sig in [
517 if sys.version_info >= (3, 9):
518 # Python >=3.9
518 expected = """\
519 '''\
520 long_function(
519 long_function(
521 a_really_long_parameter: int,
520 a_really_long_parameter: int,
522 and_another_long_one: bool = False,
521 and_another_long_one: bool = False,
523 let_us_make_sure_this_is_looong: Optional[str] = None,
522 let_us_make_sure_this_is_looong: Optional[str] = None,
524 ) -> bool\
523 ) -> bool\
525 ''',
524 """
526 # Python >=3.7
525 else:
527 '''\
526 expected = """\
528 long_function(
527 long_function(
529 a_really_long_parameter: int,
528 a_really_long_parameter: int,
530 and_another_long_one: bool = False,
529 and_another_long_one: bool = False,
531 let_us_make_sure_this_is_looong: Union[str, NoneType] = None,
530 let_us_make_sure_this_is_looong: Union[str, NoneType] = None,
532 ) -> bool\
531 ) -> bool\
533 ''', # Python <=3.6
532 """
534 '''\
533 assert sig == expected
535 long_function(
536 a_really_long_parameter:int,
537 and_another_long_one:bool=False,
538 let_us_make_sure_this_is_looong:Union[str, NoneType]=None,
539 ) -> bool\
540 ''',
541 ]
General Comments 0
You need to be logged in to leave comments. Login now