MCPcopy Create free account
hub / github.com/dask/dask / test_derived_from

Function test_derived_from

dask/tests/test_utils.py:565–599  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

563
564
565def test_derived_from():
566 class Foo:
567 def f(a, b):
568 """A super docstring
569
570 An explanation
571
572 Parameters
573 ----------
574 a: int
575 an explanation of a
576 b: float
577 an explanation of b
578 """
579
580 class Bar:
581 @derived_from(Foo)
582 def f(a, c):
583 pass
584
585 class Zap:
586 @derived_from(Foo)
587 def f(a, c):
588 "extra docstring"
589 pass
590
591 assert Bar.f.__doc__.strip().startswith("A super docstring")
592 assert "Foo.f" in Bar.f.__doc__
593 assert any("inconsistencies" in line for line in Bar.f.__doc__.split("\n")[:7])
594
595 [b_arg] = [line for line in Bar.f.__doc__.split("\n") if "b:" in line]
596 assert "not supported" in b_arg.lower()
597 assert "dask" in b_arg.lower()
598
599 assert "extra docstring\n\n" in Zap.f.__doc__
600
601
602@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

anyFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected