Skip to content

Commit

Permalink
Added missing script
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-gol committed Oct 5, 2018
1 parent 7281a5d commit fce7c47
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions run-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
import subprocess
import os


def main():
new_environ = os.environ.copy()
new_environ["DJANGO_SETTINGS_MODULE"] = "test_app.settings"
cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), "test_app"))

celery_proc = subprocess.Popen(
["celery", "worker", "-A", "tenant_schemas_celery.test_app:app", "-l", "INFO"],
env=new_environ.copy(),
cwd=cwd,
)
try:
subprocess.check_call(
["pytest", "../tenant_schemas_celery/tests.py"],
env=new_environ.copy(),
cwd=cwd,
)

finally:
celery_proc.terminate()
celery_proc.wait()


if __name__ == "__main__":
main()

0 comments on commit fce7c47

Please sign in to comment.