Disable exception catching in tests to figure out why TestPathApp cannot be imported on the build system.

This commit is contained in:
Markus Lampert
2017-06-20 14:06:15 -07:00
parent edd63bec4a
commit bd9ae7bc25
2 changed files with 15 additions and 14 deletions

View File

@@ -31,3 +31,4 @@ from PathTests.TestPathGeom import TestPathGeom
from PathTests.TestPathUtil import TestPathUtil
from PathTests.TestPathDepthParams import depthTestCases
from PathTests.TestPathDressupHoldingTags import TestHoldingTags

View File

@@ -34,24 +34,24 @@ import unittest
def tryLoadingTest(testName):
"Loads and returns testName, or a failing TestCase if unsuccessful."
try:
return unittest.defaultTestLoader.loadTestsFromName(testName)
#try:
return unittest.defaultTestLoader.loadTestsFromName(testName)
except ImportError:
class LoadFailed(unittest.TestCase):
def __init__(self, testName):
# setattr() first, because TestCase ctor checks for methodName.
setattr(self, "failed_to_load_" + testName, self._runTest)
super(LoadFailed, self).__init__("failed_to_load_" + testName)
self.testName = testName
#except ImportError as err:
# class LoadFailed(unittest.TestCase):
# def __init__(self, testName):
# # setattr() first, because TestCase ctor checks for methodName.
# setattr(self, "failed_to_load_" + testName, self._runTest)
# super(LoadFailed, self).__init__("failed_to_load_" + testName)
# self.testName = testName
def __name__(self):
return "Loading " + self.testName
# def __name__(self):
# return "Loading " + self.testName
def _runTest(self):
self.fail("Couldn't load " + self.testName)
# def _runTest(self):
# self.fail("Couldn't load " + self.testName)
return LoadFailed(testName)
# return LoadFailed(testName)
def All():
# Base system tests