X-Git-Url: https://git.phdru.name/?p=cookiecutter.git;a=blobdiff_plain;f=project_template%2Ftests%2Frun_all.py;fp=project_template%2Ftests%2Frun_all.py;h=0000000000000000000000000000000000000000;hp=2e217bf31e814c42286fc7a96912fd53e6c3680b;hb=fe3b3f07b04313b539ea8894dca05ba6e6eb60aa;hpb=11f7ea87a54f6d216640e3982d2a390b41d4d039 diff --git a/project_template/tests/run_all.py b/project_template/tests/run_all.py deleted file mode 100755 index 2e217bf..0000000 --- a/project_template/tests/run_all.py +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/env python - - -import os -import sys -import subprocess - - -def isexecutable(filename): - infile = open(filename, 'r') - magic = infile.read(2) - infile.close() - return magic == "#!" - - -def collect_tests(): - tests = [] - for dirpath, dirs, files in os.walk("tests"): - tests.extend( - [os.path.join(dirpath, filename) for filename in files - if filename.startswith("test") and filename.endswith(".py") - ]) - return [test[:-3].replace(os.sep, '.') for test in tests - if isexecutable(test)] - - -def main(): - os.chdir(os.path.join(os.path.dirname(sys.argv[0]), os.pardir)) - tests = collect_tests() - - os.environ["PYTHONPATH"] = os.curdir - - for test in sorted(tests): - print test - subprocess.call((sys.executable, '-m', test)) - -if __name__ == '__main__': - main()