diff --git a/NEWS b/NEWS index 933fbc3f..9fe6351c 100644 --- a/NEWS +++ b/NEWS @@ -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``. diff --git a/requirements.txt b/requirements.txt index 4a7c1d43..3cfa9bd3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/testtools/twistedsupport/_runtest.py b/testtools/twistedsupport/_runtest.py index c8860e95..d4f77758 100644 --- a/testtools/twistedsupport/_runtest.py +++ b/testtools/twistedsupport/_runtest.py @@ -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 @@ -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. @@ -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