Skip to content

Commit a661458

Browse files
improve unit test for definition in docstring
1 parent f8c3668 commit a661458

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

tests/test_declare.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ def test_schema_decorator():
2222
assert_true(issubclass(Subject, dj.Lookup))
2323
assert_true(not issubclass(Subject, dj.Part))
2424

25+
@staticmethod
26+
def test_class_help():
27+
help(TTest)
28+
help(TTest2)
29+
assert_true(TTest.definition in TTest.__doc__)
30+
assert_true(TTest.definition in TTest2.__doc__)
31+
32+
@staticmethod
33+
def test_instance_help():
34+
help(TTest())
35+
help(TTest2())
36+
assert_true(TTest().definition in TTest().__doc__)
37+
assert_true(TTest2().definition in TTest2().__doc__)
38+
2539
@staticmethod
2640
def test_describe():
2741
"""real_definition should match original definition"""

tests/test_relation.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ def setup_class(cls):
3636
cls.img = schema.Image()
3737
cls.trash = schema.UberTrash()
3838

39-
def test_class_help(self):
40-
help(schema.TTest)
41-
42-
def test_instance_help(self):
43-
help(schema.TTest())
44-
4539
def test_contents(self):
4640
"""
4741
test the ability of tables to self-populate using the contents property

0 commit comments

Comments
 (0)