Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test for #182
  • Loading branch information
matthid committed Jun 23, 2016
commit 8effe30d6cad5d5c0e55a1b5489ebeb59e441f9f
1 change: 1 addition & 0 deletions src/tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# other test modules that import System.Windows.Forms
# run first. They must not do module level import/AddReference()
# of the System.Windows.Forms namespace.
'test_suite',
'test_event',
'test_constructors',
'test_enum',
Expand Down
10 changes: 10 additions & 0 deletions src/tests/test_suite/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import unittest

__all__ = ['test_suite']

from .test_import import test_suite as import_tests

def test_suite():
suite = unittest.TestSuite()
suite.addTests((import_tests(),))
return suite
2 changes: 2 additions & 0 deletions src/tests/test_suite/_missing_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

import this_package_should_never_exist_ever
16 changes: 16 additions & 0 deletions src/tests/test_suite/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import unittest

class ImportTests(unittest.TestCase):
"""Test the import statement."""

def testRealtiveMissingImport(self):
"""Test that a relative missing import doesn't crash. Some modules use this to check if a package is installed (realtive import in the site-packages folder"""
try:
from . import _missing_import
except ImportError:
pass


def test_suite():
return unittest.makeSuite(ImportTests)