Skip to content

Commit

Permalink
Don't try to test deprecation warnings on twisted < 8.2.0.
Browse files Browse the repository at this point in the history
twisted.trial.unittest.TestCase.flushWarnings was added in 8.2.0.
  • Loading branch information
tomprince committed Feb 26, 2012
1 parent c1573a9 commit c03fbc4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions master/buildbot/test/unit/test_process_factory.py
Expand Up @@ -14,6 +14,8 @@
# Copyright Buildbot Team Members

from twisted.trial import unittest
from twisted.python import versions
import twisted
from mock import Mock

from buildbot.process.factory import BuildFactory, ArgumentsInTheWrongPlace, s
Expand All @@ -29,7 +31,8 @@ def test_init(self):
def test_init_deprecated(self):
factory = BuildFactory([s(BuildStep)])
self.assertEqual(factory.steps, [(BuildStep, {})])
self.assertEqual(len(self.flushWarnings([BuildFactory.__init__])), 1)
if twisted.version >= versions.Version('twisted', 8, 2, 0):
self.assertEqual(len(self.flushWarnings([BuildFactory.__init__])), 1)

def test_addStep(self):
step = BuildStep()
Expand All @@ -41,7 +44,8 @@ def test_addStep_deprecated(self):
factory = BuildFactory()
factory.addStep(BuildStep)
self.assertEqual(factory.steps, [(BuildStep, {})])
self.assertEqual(len(self.flushWarnings([BuildFactory.addStep])), 1)
if twisted.version >= versions.Version('twisted', 8, 2, 0):
self.assertEqual(len(self.flushWarnings([BuildFactory.addStep])), 1)

def test_addStep_notAStep(self):
factory = BuildFactory()
Expand Down

0 comments on commit c03fbc4

Please sign in to comment.