/usr/lib/python3/dist-packages/twisted/trial/test
NameSizeModeActions
__pycache__/-0755rm
detests.py56670644editdlrm
erroneous.py47920644editdlrm
mockcustomsuite.py5360644editdlrm
mockcustomsuite2.py5330644editdlrm
mockcustomsuite3.py6760644editdlrm
mockdoctest.py24210644editdlrm
moduleself.py1700644editdlrm
moduletest.py3020644editdlrm
novars.py1820644editdlrm
ordertests.py8640644editdlrm
packages.py46510644editdlrm
sample.py20840644editdlrm
scripttest.py4570755editdlrm
skipping.py57090644editdlrm
suppression.py24990644editdlrm
test_assertions.py608130644editdlrm
test_asyncassertions.py25520644editdlrm
test_deferred.py88220644editdlrm
test_doctest.py17130644editdlrm
test_keyboard.py37840644editdlrm
test_loader.py223600644editdlrm
test_log.py80400644editdlrm
test_output.py50160644editdlrm
test_plugins.py14600644editdlrm
test_pyunitcompat.py76200644editdlrm
test_reporter.py567090644editdlrm
test_runner.py350400644editdlrm
test_script.py293770644editdlrm
test_skip.py26510644editdlrm
test_suppression.py59110644editdlrm
test_testcase.py19850644editdlrm
test_tests.py495000644editdlrm
test_util.py196600644editdlrm
test_warning.py176380644editdlrm
weird.py6750644editdlrm
__init__.py1300644editdlrm
Edit: /usr/lib/python3/dist-packages/twisted/trial/test/test_output.py (5016B)
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the output generated by trial. """ import os from io import StringIO from twisted.scripts import trial from twisted.trial import runner from twisted.trial.test import packages _noModuleError = "No module named 'frotz'" def runTrial(*args): from twisted.trial import reporter config = trial.Options() config.parseOptions(args) output = StringIO() myRunner = runner.TrialRunner( reporter.VerboseTextReporter, stream=output, workingDirectory=config["temp-directory"], ) suite = trial._getSuite(config) myRunner.run(suite) return output.getvalue() class ImportErrorsTests(packages.SysPathManglingTest): """Actually run trial as if on the command line and check that the output is what we expect. """ def debug(self): pass parent = "_testImportErrors" def runTrial(self, *args): return runTrial("--temp-directory", self.mktemp(), *args) def _print(self, stuff): print(stuff) return stuff def assertIn(self, container, containee, *args, **kwargs): # redefined to be useful in callbacks super().assertIn(containee, container, *args, **kwargs) return container def assertNotIn(self, container, containee, *args, **kwargs): # redefined to be useful in callbacks super().assertNotIn(containee, container, *args, **kwargs) return container def test_trialRun(self): self.runTrial() def test_nonexistentModule(self): d = self.runTrial("twisted.doesntexist") self.assertIn(d, "[ERROR]") self.assertIn(d, "twisted.doesntexist") return d def test_nonexistentPackage(self): d = self.runTrial("doesntexist") self.assertIn(d, "doesntexist") self.assertIn(d, "ModuleNotFound") self.assertIn(d, "[ERROR]") return d def test_nonexistentPackageWithModule(self): d = self.runTrial("doesntexist.barney") self.assertIn(d, "doesntexist.barney") self.assertIn(d, "ObjectNotFound") self.assertIn(d, "[ERROR]") return d def test_badpackage(self): d = self.runTrial("badpackage") self.assertIn(d, "[ERROR]") self.assertIn(d, "badpackage") self.assertNotIn(d, "IOError") return d def test_moduleInBadpackage(self): d = self.runTrial("badpackage.test_module") self.assertIn(d, "[ERROR]") self.assertIn(d, "badpackage.test_module") self.assertNotIn(d, "IOError") return d def test_badmodule(self): d = self.runTrial("package.test_bad_module") self.assertIn(d, "[ERROR]") self.assertIn(d, "package.test_bad_module") self.assertNotIn(d, "IOError") self.assertNotIn(d, "