-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
46 lines (30 loc) · 1.01 KB
/
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
#!/usr/bin/env python
"""
This is tests for Probedock nose2 plugin
"""
import unittest
import time
from unittest_probedock import ProbedockTestResult
__author__ = "Benjamin Schubert <[email protected]>"
class Test(unittest.TestCase):
def test_success(self):
time.sleep(1)
self.assertTrue(True)
def test_failure(self):
time.sleep(0.2)
self.assertTrue(False)
def test_error(self):
raise Exception()
@unittest.skip("Not yet implemented")
def test_skip(self):
raise Exception()
@unittest.expectedFailure
def test_expected_failure(self):
self.assertTrue(False)
@unittest.expectedFailure
def test_unexpected_success(self):
self.assertTrue(True)
if __name__ == '__main__':
test_modules = unittest.defaultTestLoader.discover(start_dir='.', pattern='test*.py', top_level_dir=None)
res = unittest.TextTestRunner(verbosity=2, resultclass=ProbedockTestResult).run(test_modules).wasSuccessful()
exit(not res)