-
Notifications
You must be signed in to change notification settings - Fork 36
/
run_tests.py
58 lines (46 loc) · 1.29 KB
/
run_tests.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
"""Test Pure Python functionality"""
import os
import sys
import nose
import flaky.flaky_nose_plugin as flaky
# For nose
if sys.version_info[0] == 3:
import collections
collections.Callable = collections.abc.Callable
if __name__ == "__main__":
print("Initialising Maya..")
from maya import standalone, cmds
standalone.initialize()
cmds.loadPlugin("matrixNodes", quiet=True)
argv = sys.argv[:]
argv.extend([
"--verbose",
"--with-doctest",
"--with-flaky",
"--with-coverage",
"--cover-html",
"--cover-package", "cmdx",
"--cover-erase",
"--cover-tests",
"tests.py",
"test_performance.py",
"cmdx.py",
])
result = nose.main(
argv=argv,
addplugins=[flaky.FlakyPlugin()],
# We'll exit in our own way,
# since Maya typically enjoys throwing
# segfaults during cleanup of normal exits
exit=False
)
if os.getenv("TRAVIS_JOB_ID"):
import coveralls
coveralls.wear()
else:
sys.stdout.write("Skipping coveralls\n")
if os.name == "nt":
# Graceful exit, only Windows seems to like this consistently
standalone.uninitialize()
# Trust but verify
os._exit(0 if result.success else 1)