Skip to content

Commit fceace5

Browse files
committed
Add tests for __qualname__
1 parent f7c1509 commit fceace5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/test_functions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from ._division_data import DivisionData
88

99
import pytest
10+
import six
1011

1112

1213
###
@@ -87,6 +88,11 @@ def test_name():
8788
assert divide.__name__ == 'divide'
8889

8990

91+
@pytest.mark.skipif(six.PY2, reason='__qualname__ introduced in Python 3.3')
92+
def test_qualname():
93+
assert divide.__qualname__ == 'divide'
94+
95+
9096
def test_docstring():
9197
assert divide.__doc__ == """A function that divides x by y."""
9298

tests/test_instance_methods.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import math
44

55
import pytest
6+
import six
67

78
import variants
89
from ._division_data import DivisionData
@@ -92,6 +93,12 @@ def test_name():
9293
assert dv.divide.__name__ == 'divide'
9394

9495

96+
@pytest.mark.skipif(six.PY2, reason='__qualname__ introduced in Python 3.3')
97+
def test_qualname():
98+
dv = DivisionVariants(0)
99+
assert dv.divide.__qualname__ == 'DivisionVariants.divide'
100+
101+
95102
def test_docstring():
96103
dv = DivisionVariants(0)
97104
assert dv.divide.__doc__ == """Function that divides the bound x by y."""

0 commit comments

Comments
 (0)