SetupError should not have __context__ (causes "During handling of the above exception, another exception occurred")
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Fixtures |
In Progress
|
Undecided
|
Free Ekanayaka |
Bug Description
With Python 3, if a fixture raises an exception in its _setUp() method, the details text content rendered by testtools.
the Fixture.setUp machinery itself raises in order to wrap fixture details.
That's because Python 3 will set SetupError.
For example:
Tests running...
=======
ERROR: test_foo.
-------
traceback-1: {{{
Traceback (most recent call last):
File "/usr/lib/
self._setUp()
File "/home/
raise RuntimeError(
RuntimeError: boom
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/
raise SetupError(details)
fixtures.
}}}
Traceback (most recent call last):
File "/usr/lib/
self._setUp()
File "/home/
raise RuntimeError(
RuntimeError: boom
To reproduce:
from fixtures import Fixture
from testtools import TestCase
class FooFixture(
def _setUp(self):
raise RuntimeError(
class FooTest(TestCase):
def setUp(self):
def test_foo(self):
pass
description: | updated |
description: | updated |
Changed in python-fixtures: | |
assignee: | nobody → Free Ekanayaka (free.ekanayaka) |
status: | New → In Progress |