MCPcopy Create free account
hub / github.com/ipython/ipython / test_render_signature_long

Function test_render_signature_long

IPython/core/tests/test_oinspect.py:410–447  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

408
409
410def test_render_signature_long():
411 from typing import Optional
412
413 def long_function(
414 a_really_long_parameter: int,
415 and_another_long_one: bool = False,
416 let_us_make_sure_this_is_looong: Optional[str] = None,
417 ) -> bool: pass
418
419 sig = oinspect._render_signature(
420 signature(long_function),
421 long_function.__name__,
422 )
423 nt.assert_in(sig, [
424 # Python >=3.9
425 '''\
426long_function(
427 a_really_long_parameter: int,
428 and_another_long_one: bool = False,
429 let_us_make_sure_this_is_looong: Optional[str] = None,
430) -> bool\
431''',
432 # Python >=3.7
433 '''\
434long_function(
435 a_really_long_parameter: int,
436 and_another_long_one: bool = False,
437 let_us_make_sure_this_is_looong: Union[str, NoneType] = None,
438) -> bool\
439''&#x27;, # Python <=3.6
440 ''&#x27;\
441long_function(
442 a_really_long_parameter:int,
443 and_another_long_one:bool=False,
444 let_us_make_sure_this_is_looong:Union[str, NoneType]=None,
445) -> bool\
446''&#x27;,
447 ])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected