-
Notifications
You must be signed in to change notification settings - Fork 17
/
runtests.py
executable file
·63 lines (56 loc) · 1.36 KB
/
runtests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python
from logging import config
import os
import sys
import pytest
LOGGING_CONFIG = {
'version': 1,
'disable_existing_loggers': False,
'root': {
'level': 'INFO',
'handlers': ['console'],
},
'formatters': {
'verbose': {
'format': '{levelname} {asctime} {module} {process:d} '
'{thread:d} {message}',
'style': '{',
},
'simple': {
'format': '{levelname} {message}',
'style': '{',
},
},
'handlers': {
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
},
'loggers': {
'graphene_elastic': {
'handlers': ['console'],
'propagate': True,
},
},
}
config.dictConfig(LOGGING_CONFIG)
def main():
os.environ.setdefault(
"GRAPHENE_ELASTIC_EXAMPLE_BLOG_POST_DOCUMENT_NAME",
"test_blog_post"
)
os.environ.setdefault(
"GRAPHENE_ELASTIC_EXAMPLE_SITE_USER_DOCUMENT_NAME",
"test_site_user"
)
os.environ.setdefault(
"GRAPHENE_ELASTIC_EXAMPLE_FARM_ANIMAL_DOCUMENT_NAME",
"test_farm_animal"
)
sys.path.insert(0, "src")
sys.path.insert(0, "examples")
return pytest.main()
if __name__ == '__main__':
sys.exit(main())