-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuite.py
More file actions
42 lines (27 loc) · 852 Bytes
/
suite.py
File metadata and controls
42 lines (27 loc) · 852 Bytes
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
from __future__ import absolute_import, with_statement, print_function
import os
import sys
import unittest
from contextlib import contextmanager
CURRENT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__)))
PARENT_REPO_DIR = os.path.join(CURRENT_DIR, "..")
TEST_DIR = os.path.join(PARENT_REPO_DIR, "tests")
def session_setup():
import maya.standalone
maya.standalone.initialize(name="python")
def session_teardown():
import maya.standalone
maya.standalone.uninitialize()
@contextmanager
def mayapy_session():
session_setup()
yield
session_teardown()
def main():
runner = unittest.TextTestRunner()
loader = unittest.TestLoader()
with mayapy_session():
suite = loader.discover(TEST_DIR)
return bool(runner.run(suite).errors)
if __name__ == "__main__":
sys.exit(main())