Added simple testing of the README to make sure it includes a mention of each code file

This commit is contained in:
Elmom 2010-10-29 11:46:12 +03:00
parent 595cd506fb
commit a718a8bcfd

17
test_docs.py Normal file
View file

@ -0,0 +1,17 @@
import py
dirpath = py.path.local("./")
def pytest_generate_tests(metafunc):
if "filename" in metafunc.funcargnames:
for fpath in dirpath.visit('*.scad'):
metafunc.addcall(funcargs=dict(filename=fpath.basename))
for fpath in dirpath.visit('*.py'):
name = fpath.basename
if not name.startswith('test_'):
metafunc.addcall(funcargs=dict(filename=fpath.basename))
def test_README(filename):
README = dirpath.join('README').read()
assert filename in README