MCAD-Library/test_docs.py

19 lines
615 B
Python
Raw Normal View History

import py
2011-09-07 20:52:11 -05:00
import os.path
dirpath = py.path.local("./")
def pytest_generate_tests(metafunc):
if "filename" in metafunc.funcargnames:
for fpath in dirpath.visit('*.scad'):
2011-09-07 20:52:11 -05:00
metafunc.addcall(id=fpath.basename, funcargs=dict(filename=fpath.basename))
for fpath in dirpath.visit('*.py'):
name = fpath.basename
if not (name.startswith('test_') or name.startswith('_')):
2011-09-07 20:52:11 -05:00
metafunc.addcall(id=fpath.basename, funcargs=dict(filename=fpath.basename))
def test_README(filename):
README = dirpath.join('README').read()
assert filename in README