File: test_docstring.py

package info (click to toggle)
python-multimethod 2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164 kB
  • sloc: python: 731; makefile: 13
file content (31 lines) | stat: -rw-r--r-- 487 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from multimethod import multimethod


@multimethod
def foo(bar: int):
    """
    Argument is an integer
    """
    pass


@multimethod
def foo(bar: str):
    """
    Argument is a string
    """
    pass


@foo.register
def _(bar: float):
    pass


def test_docstring():
    """
    Test if multimethod collects its children's docstrings
    """
    assert "Argument is an integer" in foo.__doc__
    assert "Argument is a string" in foo.__doc__
    assert "float" not in foo.__doc__