Apparently the answer to my question "Can I restrict nose coverage output to directory (rather than package)?" is no, but I can pass a --coverage-package=PACKAGE
option to nose with the package name of each .py file in the directory.
So for example, if the directory contains:
foo.py
bar.py
baz.py
...then I would need to use the command:
nosetests --with-coverage --coverage-package=foo --coverage-package=bar --coverage-package=baz
So my question is, can someone write some shell script code (preferably sh or bash) to take all the filenames in the current directory with a .py extension and generate the above command-line (with the .py extensions removed)? My bash skills are quite limited. (I'm tempted to just do it in Python.)