This should work with newer versions of nose , but I have not tested it on nested modules.
echo 'import '"$PACKAGE"', inspect; print("\n".join(x[0] for x in inspect.getmembers('"$PACKAGE"', inspect.ismodule)))' | python | xargs -L 1 --replace echo "$PACKAGE.{}" | nose $(cat) --with-doctest
If you know an easier way to retrieve a list of modules in doctest (perhaps using a nose?), Then what the first part really does.
source share