Commit f2c3d2f5 authored by Michael Salim's avatar Michael Salim
Browse files

run_tests directory creation moved back into main

parent bb7cbf2a
...@@ -14,8 +14,12 @@ def set_permissions(top): ...@@ -14,8 +14,12 @@ def set_permissions(top):
for file in (os.path.join(root, f) for f in files): for file in (os.path.join(root, f) for f in files):
os.chmod(file, 0o644) os.chmod(file, 0o644)
def main(test_directory): def main():
test_dir = os.path.abspath(os.path.dirname(balsam.__file__))
tempdir = tempfile.TemporaryDirectory(dir=test_dir, prefix="testdata_")
test_directory = tempdir.name
os.environ['BALSAM_TEST_DIRECTORY'] = test_directory os.environ['BALSAM_TEST_DIRECTORY'] = test_directory
os.environ['BALSAM_TEST']='1' os.environ['BALSAM_TEST']='1'
os.environ['DJANGO_SETTINGS_MODULE'] = 'balsam.django_config.settings' os.environ['DJANGO_SETTINGS_MODULE'] = 'balsam.django_config.settings'
...@@ -32,6 +36,4 @@ def main(test_directory): ...@@ -32,6 +36,4 @@ def main(test_directory):
unittest.TextTestRunner(verbosity=2).run(suite) unittest.TextTestRunner(verbosity=2).run(suite)
if __name__ == "__main__": if __name__ == "__main__":
test_dir = os.path.abspath(os.path.dirname(balsam.__file__)) main()
tempdir = tempfile.TemporaryDirectory(dir=test_dir, prefix="testdata_")
main(tempdir.name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment