Show More
@@ -22,6 +22,7 b' from IPython import get_ipython' | |||
|
22 | 22 | from IPython.testing.tools import AssertPrints, AssertNotPrints |
|
23 | 23 | from IPython.utils.path import compress_user |
|
24 | 24 | |
|
25 | ||
|
25 | 26 | #----------------------------------------------------------------------------- |
|
26 | 27 | # Globals and constants |
|
27 | 28 | #----------------------------------------------------------------------------- |
@@ -433,12 +434,12 b' def test_builtin_init():' | |||
|
433 | 434 | |
|
434 | 435 | |
|
435 | 436 | def test_render_signature_short(): |
|
436 |
def short_fun(a |
|
|
437 | def short_fun(a=1): pass | |
|
437 | 438 | sig = oinspect._render_signature( |
|
438 | 439 | signature(short_fun), |
|
439 | 440 | short_fun.__name__, |
|
440 | 441 | ) |
|
441 |
nt.assert_equal(sig, 'short_fun(a |
|
|
442 | nt.assert_equal(sig, 'short_fun(a=1)') | |
|
442 | 443 | |
|
443 | 444 | |
|
444 | 445 | def test_render_signature_long(): |
@@ -454,10 +455,20 b' def test_render_signature_long():' | |||
|
454 | 455 | signature(long_function), |
|
455 | 456 | long_function.__name__, |
|
456 | 457 | ) |
|
457 |
nt.assert_ |
|
|
458 | nt.assert_in(sig, [ | |
|
459 | # Python >=3.7 | |
|
460 | '''\ | |
|
461 | long_function( | |
|
462 | a_really_long_parameter: int, | |
|
463 | and_another_long_one: bool = False, | |
|
464 | let_us_make_sure_this_is_looong: Union[str, NoneType] = None, | |
|
465 | ) -> bool\ | |
|
466 | ''', # Python <=3.6 | |
|
467 | '''\ | |
|
458 | 468 |
|
|
459 | 469 |
a_really_long_parameter: |
|
460 | 470 |
and_another_long_one: |
|
461 | 471 |
let_us_make_sure_this_is_looong: |
|
462 | 472 | ) -> bool\ |
|
463 |
|
|
|
473 | ''', | |
|
474 | ]) |
General Comments 0
You need to be logged in to leave comments.
Login now