From a718a8bcfd443b5a03f9324f352b0c7b43670fd0 Mon Sep 17 00:00:00 2001 From: Elmom Date: Fri, 29 Oct 2010 11:46:12 +0300 Subject: [PATCH] Added simple testing of the README to make sure it includes a mention of each code file --- test_docs.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test_docs.py diff --git a/test_docs.py b/test_docs.py new file mode 100644 index 0000000..4aebf17 --- /dev/null +++ b/test_docs.py @@ -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