Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Improvements
* Distutils integration is deprecated and will be removed in the next major
version.

* Use ``CompoundFixture`` from ``fixtures>=2.0`` rather than rolling our
own.

* Provide a ``testtools[twisted]`` extra documenting dependencies needed for
``testtools.twistedsupport``.

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pbr>=0.11
# TODO(stephenfin): Remove this once fixtures no longer depends on extras
# or explicitly specifies the dependency
extras>=1.0.0
fixtures>=1.3.0
fixtures>=2.0
18 changes: 2 additions & 16 deletions testtools/twistedsupport/_runtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_something(self):
import warnings
import sys

from fixtures import Fixture
from fixtures import CompoundFixture, Fixture

from testtools.content import Content, text_content
from testtools.content_type import UTF8_TEXT
Expand Down Expand Up @@ -194,20 +194,6 @@ def run_with_log_observers(observers, function, *args, **kwargs):
_log_observer = _LogObserver()


# XXX: Should really be in python-fixtures.
# See https://github.com/testing-cabal/fixtures/pull/22.
class _CompoundFixture(Fixture):
"""A fixture that combines many fixtures."""

def __init__(self, fixtures):
super().__init__()
self._fixtures = fixtures

def _setUp(self):
for fixture in self._fixtures:
self.useFixture(fixture)


def flush_logged_errors(*error_types):
"""Flush errors of the given types from the global Twisted log.

Expand Down Expand Up @@ -411,7 +397,7 @@ def _get_log_fixture(self):
fixtures.append(_NoTwistedLogObservers())
if self._store_twisted_logs:
fixtures.append(CaptureTwistedLogs())
return _CompoundFixture(fixtures)
return CompoundFixture(fixtures)

def _run_core(self):
# XXX: Blatting over the namespace of the test case isn't a nice thing
Expand Down