> You shouldn't need to do this path munging on a per test basis just
> run unit_test_runner against a particular unit_test.py file or a
> directory of unit tests and everyting should work
>
> e.g.
>
> ./unit_test_runner.py data/test_diff_tensor.py
>
> or in unit_tests
> ./unit_test_runner.py .
>
>
> the unit test runner should do all the munging finding and loading for you
An alternative would be nice, which would use Gary's unit_test_runner
infrastructure but retain the convention that unit test modules can be
run with the simple command line syntax:
python ./test_my_function.py
Something like:
if __name__ == "__main__":
from unit_test_runner import Run_unit_tests
runner = Run_unit_tests(test_module=__file__, verbose=True)
runner.run()
at the bottom of each unit test module should do it.
That sounds like a good solution which allows a different mode of
operation for the unit tests. With the line:
#! /usr/bin/env python
at the start and with the executable bit turned on in the repository,
then in Posix systems you wouldn't even need to type python to run the
test. Gary, what do you think?
Edward