Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93966ff

Browse files
author
Barton Cline
committed
* Reordered test_* for namespace loading optimization.
* test_compat.py will stand alone with added import of System or clr
1 parent 0b066e8 commit 93966ff

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

pythonnet/src/tests/runtests.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,24 @@
2222
import clr
2323

2424
test_modules = (
25+
'test_module', # Passes on its own, but not here if
26+
# other test modules that import System.Windows.Forms
27+
# run first. They must not do module level import/AddReference()
28+
# of the System.Windows.Forms namespace.
29+
'test_event',
30+
'test_constructors',
31+
'test_enum',
32+
'test_method',
33+
2534
'test_exceptions',
26-
'test_module',
2735
'test_compat',
2836
'test_generic',
2937
'test_conversion',
3038
'test_class',
3139
'test_interface',
32-
'test_enum',
3340
'test_field',
3441
'test_property',
3542
'test_indexer',
36-
'test_event',
37-
'test_method',
3843
'test_delegate',
3944
'test_array',
4045
'test_thread'

pythonnet/src/tests/test_compat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,5 +262,11 @@ def main():
262262
unittest.TextTestRunner().run(test_suite())
263263

264264
if __name__ == '__main__':
265+
try:
266+
import System
267+
except ImportError:
268+
print "Load clr import hook"
269+
import clr
270+
265271
main()
266272

0 commit comments

Comments
 (0)