diff --git twisted/trial/runner.py twisted/trial/runner.py
index 4275c24..12f93c6 100644
|
|
A miscellany of code used to run Trial tests. |
8 | 8 | Maintainer: Jonathan Lange |
9 | 9 | """ |
10 | 10 | |
| 11 | from __future__ import print_function,division,absolute_import |
| 12 | from twisted.python.compat import _PY3 |
| 13 | |
11 | 14 | __all__ = [ |
12 | 15 | 'TestSuite', |
13 | 16 | |
… |
… |
from twisted.trial.reporter import _ExitWrapper, UncleanWarningsReporterWrapper |
33 | 36 | # These are imported so that they remain in the public API for t.trial.runner |
34 | 37 | from twisted.trial.unittest import TestSuite |
35 | 38 | |
36 | | from zope.interface import implements |
| 39 | from zope.interface import implementer |
37 | 40 | |
38 | 41 | pyunit = __import__('unittest') |
39 | 42 | |
… |
… |
def isTestCase(obj): |
252 | 255 | |
253 | 256 | |
254 | 257 | |
| 258 | @implementer(ITestCase) |
255 | 259 | class TestHolder(object): |
256 | 260 | """ |
257 | 261 | Placeholder for a L{TestCase} inside a reporter. As far as a L{TestResult} |
258 | 262 | is concerned, this looks exactly like a unit test. |
259 | 263 | """ |
260 | 264 | |
261 | | implements(ITestCase) |
262 | | |
263 | 265 | failureException = None |
264 | 266 | |
265 | 267 | def __init__(self, description): |
… |
… |
class TrialRunner(object): |
652 | 654 | def _setUpTestdir(self): |
653 | 655 | self._tearDownLogFile() |
654 | 656 | currentDir = os.getcwd() |
655 | | base = filepath.FilePath(self.workingDirectory) |
| 657 | base = filepath.FilePath(self.workingDirectory.encode('utf-8')) |
656 | 658 | testdir, self._testDirLock = util._unusedTestDirectory(base) |
657 | 659 | os.chdir(testdir.path) |
658 | 660 | return currentDir |
… |
… |
class TrialRunner(object): |
715 | 717 | if self.logfile == '-': |
716 | 718 | logFile = sys.stdout |
717 | 719 | else: |
718 | | logFile = file(self.logfile, 'a') |
| 720 | logFile = open(self.logfile, 'a') |
719 | 721 | self._logFileObject = logFile |
720 | 722 | self._logFileObserver = log.FileLogObserver(logFile) |
721 | 723 | log.startLoggingWithObserver(self._logFileObserver.emit, 0) |