-
-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathruntests.py
More file actions
executable file
·23 lines (19 loc) · 698 Bytes
/
runtests.py
File metadata and controls
executable file
·23 lines (19 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, "tests")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openwisp2.settings")
if __name__ == "__main__":
import pytest
from django.core.management import execute_from_command_line
args = sys.argv
args.insert(1, "test")
if not os.environ.get("SAMPLE_APP", False):
args.insert(2, "openwisp_notifications")
app_dir = ["openwisp_notifications"]
else:
args.insert(2, "openwisp2")
app_dir = ["tests", "openwisp2", "sample_notifications"]
execute_from_command_line(args)
sys.exit(pytest.main([os.path.join(*app_dir, "tests", "test_websockets.py")]))