diff options
| author | Jonathan Lange <jml@mumak.net> | 2015-10-31 13:22:31 +0000 |
|---|---|---|
| committer | Jonathan Lange <jml@mumak.net> | 2015-10-31 13:22:31 +0000 |
| commit | cc563196404601c39045cb178d6c94e90e23ae5c (patch) | |
| tree | 34c680920a764daa1beb28c9319de9f4f7549a79 | |
| parent | 6d941c657e00057e17ddfe40c1e4492bf222db4a (diff) | |
| download | fixtures-git-cc563196404601c39045cb178d6c94e90e23ae5c.tar.gz | |
Spelling and lint fixes
"cach" -> "catch"
| -rw-r--r-- | fixtures/callmany.py | 6 | ||||
| -rw-r--r-- | fixtures/fixture.py | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/fixtures/callmany.py b/fixtures/callmany.py index 23580cb..e0a7f8e 100644 --- a/fixtures/callmany.py +++ b/fixtures/callmany.py @@ -67,7 +67,8 @@ class CallMany(object): re-raised after all the functions have run. If multiple exceptions are raised, they are all wrapped into a MultipleExceptions object, and that is raised. - Thus, to cach a specific exception from a function run by __call__, + + Thus, to catch a specific exception from a function run by __call__, you need to catch both the exception and MultipleExceptions, and then check within a MultipleExceptions instance for an occurance of the type you wish to catch. @@ -96,5 +97,4 @@ class CallMany(object): def __exit__(self, exc_type, exc_val, exc_tb): self() - return False # propogate exceptions from the with body. - + return False # propogate exceptions from the with body. diff --git a/fixtures/fixture.py b/fixtures/fixture.py index 2b5ec9d..f44974b 100644 --- a/fixtures/fixture.py +++ b/fixtures/fixture.py @@ -27,7 +27,6 @@ import sys import six from testtools.compat import ( advance_iterator, - reraise, ) from testtools.helpers import try_import @@ -115,7 +114,7 @@ class Fixture(object): if a single exception is raised, it is reraised after all the cleanUps have run. If multiple exceptions are raised, they are all wrapped into a MultipleExceptions object, and that is reraised. - Thus, to cach a specific exception from cleanUp, you need to catch + Thus, to catch a specific exception from cleanUp, you need to catch both the exception and MultipleExceptions, and then check within a MultipleExceptions instance for the type you're catching. :return: A list of the exc_info() for each exception that occured if @@ -157,7 +156,7 @@ class Fixture(object): self._cleanups() finally: self._remove_state() - return False # propogate exceptions from the with body. + return False # propogate exceptions from the with body. def getDetails(self): """Get the current details registered with the fixture. @@ -206,7 +205,7 @@ class Fixture(object): errors = [err] + self.cleanUp(raise_first=False) try: raise SetupError(details) - except SetupError as e: + except SetupError: errors.append(sys.exc_info()) if issubclass(err[0], Exception): raise MultipleExceptions(*errors) @@ -381,12 +380,12 @@ class MethodFixture(Fixture): if setup is None: setup = getattr(obj, 'setUp', None) if setup is None: - setup = lambda:None + setup = lambda: None self._setup = setup if cleanup is None: cleanup = getattr(obj, 'tearDown', None) if cleanup is None: - cleanup = lambda:None + cleanup = lambda: None self._cleanup = cleanup if reset is None: reset = getattr(obj, 'reset', None) |
