Skip to content

Commit 129c2cb

Browse files
committed
fix doctest, docs
1 parent 9f6715b commit 129c2cb

8 files changed

Lines changed: 20 additions & 10 deletions

File tree

.ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ignore = [
1313
"D401", # non-imperative-mood
1414
"D403", # first-word-uncapitalized
1515
"D415", # missing-terminal-punctuation
16+
"D412", # otherwise docstring tests will be badly formatted - we need empty line
1617
#"S101", # assert
1718
"S113", # request-without-timeout
1819
"S310", # suspicious-url-open-usage

datatools/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55
__all__ = []
66

77

8-
def test():
9-
"""Example:
8+
def self_check():
9+
"""check that setup is working.
1010
11-
>>> test()
12-
True
11+
Example:
12+
13+
>>> self_check()
14+
True
1315
1416
"""
1517
return True
18+
19+
20+
# self check on import
21+
self_check()
File renamed without changes.
File renamed without changes.

docs/example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Example script."""
22

3-
from datatools import test
3+
from datatools import self_check
44

5-
if not test():
5+
if not self_check():
66
raise Exception()
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
# README
2-
31
--8<-- "README.md"

mkdocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ plugins:
3737
python:
3838
# either install package or provide path here
3939
# relative to from inside docs/ foldler (example.py)
40-
paths: ["../datatools"]
40+
#paths: ["../datatools"]
4141
options:
4242
filters:
4343
- "!^_[^_]"
@@ -50,3 +50,8 @@ plugins:
5050
show_signature_annotations: true
5151
- search:
5252
lang: en
53+
54+
nav:
55+
- index.md
56+
- example.md
57+
- api.md

tests/test_docs_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ def test_docs_example_py(self):
2626

2727
def test_main_test(self):
2828
"""Run tets() function from main"""
29-
self.assertTrue(datatools.test())
29+
self.assertTrue(datatools.self_check())

0 commit comments

Comments
 (0)