-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy path__init__.py
44 lines (38 loc) · 1.38 KB
/
__init__.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
# -*- coding:utf-8 -*-
import sys
try:
from setuptools import Command, setup
except ImportError:
from distutils.core import Command, setup
try:
import unittest2 as unittest
except ImportError:
import unittest
from tests import maintest
from tests import deprecationtest
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if(sys.stdout.encoding == 'utf-8'):
print('╭─────────────────────────────────────╮')
print('│ │')
print('│ Test Start │')
print('│ │')
print('╰─────────────────────────────────────╯')
else:
print('Test Start')
import tests
testSuite = unittest.TestSuite(tests.testsuite())
runner = unittest.TextTestRunner(verbosity=2)
results = runner.run(testSuite)
sys.exit(0 if results.wasSuccessful() else 1)
pass
def testsuite():
suite = unittest.TestSuite()
suite.addTests(maintest.testsuite())
# suite.addTests(deprecationtest.testsuite())
return suite