2010-10-29 03:46:12 -05:00
|
|
|
import py
|
2011-09-07 20:52:11 -05:00
|
|
|
import os.path
|
2010-10-29 03:46:12 -05:00
|
|
|
|
|
|
|
dirpath = py.path.local("./")
|
|
|
|
|
|
|
|
def pytest_generate_tests(metafunc):
|
2018-09-23 12:03:17 -05:00
|
|
|
names = []
|
2010-10-29 03:46:12 -05:00
|
|
|
if "filename" in metafunc.funcargnames:
|
|
|
|
for fpath in dirpath.visit('*.scad'):
|
2018-09-23 12:03:17 -05:00
|
|
|
names.append(fpath.basename)
|
2010-10-29 03:46:12 -05:00
|
|
|
for fpath in dirpath.visit('*.py'):
|
|
|
|
name = fpath.basename
|
2010-10-30 04:57:26 -05:00
|
|
|
if not (name.startswith('test_') or name.startswith('_')):
|
2018-09-23 12:03:17 -05:00
|
|
|
names.append(name)
|
|
|
|
metafunc.parametrize("filename", names)
|
2010-10-29 03:46:12 -05:00
|
|
|
|
|
|
|
def test_README(filename):
|
2018-09-23 12:03:17 -05:00
|
|
|
README = dirpath.join('README.markdown').read()
|
2010-10-29 03:46:12 -05:00
|
|
|
|
|
|
|
assert filename in README
|