Skip to content

Commit cb3555c

Browse files
committed
Add exception raise for test failures or errors.
1 parent 0f74d9a commit cb3555c

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ install:
3030

3131
# command to run tests
3232
script:
33-
- python setup.py test
33+
- cd tests
34+
- python vaspy_test.py
3435

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,6 @@
108108
url=url,
109109
download_url=download_url,
110110
version=version,
111-
test_suite="tests",
111+
# test_suite="tests",
112112
classifiers=classifiers)
113113

tests/vaspy_test.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
import commands
4+
import unittest
5+
6+
from arc_test import ArcTest
7+
from incar_test import InCarTest
8+
from oszicar_test import OsziCarTest
9+
from outcar_test import OutCarTest
10+
from xsd_test import XsdTest
11+
from xtd_test import XtdTest
12+
13+
def suite():
14+
suite = unittest.TestSuite([
15+
unittest.TestLoader().loadTestsFromTestCase(ArcTest),
16+
unittest.TestLoader().loadTestsFromTestCase(InCarTest),
17+
unittest.TestLoader().loadTestsFromTestCase(OsziCarTest),
18+
unittest.TestLoader().loadTestsFromTestCase(OutCarTest),
19+
unittest.TestLoader().loadTestsFromTestCase(XsdTest),
20+
unittest.TestLoader().loadTestsFromTestCase(XtdTest),
21+
])
22+
23+
return suite
24+
25+
if "__main__" == __name__:
26+
result = unittest.TextTestRunner(verbosity=2).run(suite())
27+
28+
if result.errors or result.failures:
29+
raise ValueError("Get errors and failures.")
30+

0 commit comments

Comments
 (0)