File tree Expand file tree Collapse file tree 3 files changed +31
-31
lines changed
testapps/on_device_unit_tests/test_app Expand file tree Collapse file tree 3 files changed +31
-31
lines changed Original file line number Diff line number Diff line change 4
4
'require Python 3+' ).format (sys .version_info .major ))
5
5
6
6
import unittest
7
- import importlib
8
7
9
8
print ('Imported unittest' )
10
9
11
-
12
- class PythonTestMixIn (object ):
13
-
14
- module_import = None
15
-
16
- def test_import_module (self ):
17
- """Test importing the specified Python module name. This import test
18
- is common to all Python modules, it does not test any further
19
- functionality.
20
- """
21
- self .assertIsNotNone (
22
- self .module_import ,
23
- 'module_import is not set (was default None)' )
24
-
25
- importlib .import_module (self .module_import )
26
-
27
- def test_run_module (self ):
28
- """Import the specified module and do something with it as a minimal
29
- check that it actually works.
30
-
31
- This test fails by default, it must be overridden by every
32
- child test class.
33
- """
34
-
35
- self .fail ('This test must be overridden by {}' .format (self ))
36
-
37
- print ('Defined test case' )
38
-
39
- import sys
40
10
sys .path .append ('./' )
41
11
from tests import test_requirements
42
12
suite = unittest .TestLoader ().loadTestsFromModule (test_requirements )
Original file line number Diff line number Diff line change
1
+ import importlib
2
+
3
+
4
+ class PythonTestMixIn (object ):
5
+
6
+ module_import = None
7
+
8
+ def test_import_module (self ):
9
+ """Test importing the specified Python module name. This import test
10
+ is common to all Python modules, it does not test any further
11
+ functionality.
12
+ """
13
+ self .assertIsNotNone (
14
+ self .module_import ,
15
+ 'module_import is not set (was default None)' )
16
+
17
+ importlib .import_module (self .module_import )
18
+
19
+ def test_run_module (self ):
20
+ """Import the specified module and do something with it as a minimal
21
+ check that it actually works.
22
+
23
+ This test fails by default, it must be overridden by every
24
+ child test class.
25
+ """
26
+
27
+ self .fail ('This test must be overridden by {}' .format (self ))
28
+
29
+
30
+ print ('Defined test case' )
Original file line number Diff line number Diff line change 1
1
2
- from main import PythonTestMixIn
3
2
from unittest import TestCase
3
+ from .mixin import PythonTestMixIn
4
4
5
5
6
6
class NumpyTestCase (PythonTestMixIn , TestCase ):
You can’t perform that action at this time.
0 commit comments