Commit 5f7c8d09 authored by Vincent Pelletier's avatar Vincent Pelletier

Stop accessing private properties.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2232 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bd2b4512
...@@ -534,10 +534,7 @@ class NEOFunctionalTest(unittest.TestCase): ...@@ -534,10 +534,7 @@ class NEOFunctionalTest(unittest.TestCase):
temp_dir = tempfile.mkdtemp(prefix='neo_') temp_dir = tempfile.mkdtemp(prefix='neo_')
print 'Using temp directory %r.' % (temp_dir, ) print 'Using temp directory %r.' % (temp_dir, )
# build the full path based on test case and current test method # build the full path based on test case and current test method
test_case_name = self.__class__.__name__ temp_dir = os.path.join(temp_dir, self.id())
test_method_name = self._TestCase__testMethodName
temp_dir = os.path.join(temp_dir, test_case_name)
temp_dir = os.path.join(temp_dir, test_method_name)
# build the path if needed # build the path if needed
if not os.path.exists(temp_dir): if not os.path.exists(temp_dir):
os.makedirs(temp_dir) os.makedirs(temp_dir)
......
...@@ -158,12 +158,11 @@ class NeoTestRunner(unittest.TestResult): ...@@ -158,12 +158,11 @@ class NeoTestRunner(unittest.TestResult):
stats.time += time.time() - self.lastStart stats.time += time.time() - self.lastStart
def startTest(self, test): def startTest(self, test):
print ' * %s %s...' % (test.__class__.__module__[10:], module = test.__class__.__name__
test._TestCase__testMethodName), method = test.id()
sys.stdout.write(' * %s ' % (method, ))
sys.stdout.flush() sys.stdout.flush()
unittest.TestResult.startTest(self, test) unittest.TestResult.startTest(self, test)
module = test.__class__.__name__
method = test._TestCase__testMethodName
logging.info(" * TEST %s" % test) logging.info(" * TEST %s" % test)
stats = self._getModuleStats(test) stats = self._getModuleStats(test)
stats.run += 1 stats.run += 1
...@@ -252,11 +251,7 @@ class NeoTestRunner(unittest.TestResult): ...@@ -252,11 +251,7 @@ class NeoTestRunner(unittest.TestResult):
def _buildErrors(self): def _buildErrors(self):
s = '\n' s = '\n'
test_formatter = lambda t: '%s.py %s.%s' % ( test_formatter = lambda t: t.id()
t.__class__.__module__.replace('.', '/'),
t.__class__.__name__,
t._TestCase__testMethodName,
)
if len(self.errors): if len(self.errors):
s += '\nERRORS:\n' s += '\nERRORS:\n'
for test, trace in self.errors: for test, trace in self.errors:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment