1
# Copyright (c) 2010 Twisted Matrix Laboratories.
2
# See LICENSE for details.
5
Tests for the deprecated L{twisted.test.time_helpers} module.
10
from twisted.trial.unittest import TestCase
13
class TimeHelpersTests(TestCase):
15
A test for the deprecation of the module.
17
def test_deprecated(self):
19
Importing L{twisted.test.time_helpers} causes a deprecation warning
22
# Make sure we're really importing it
23
sys.modules.pop('twisted.test.time_helpers', None)
24
import twisted.test.time_helpers
25
warnings = self.flushWarnings(
26
offendingFunctions=[self.test_deprecated])
27
self.assertEquals(warnings[0]['category'], DeprecationWarning)
29
warnings[0]['message'],
30
"twisted.test.time_helpers is deprecated since Twisted 10.0. "
31
"See twisted.internet.task.Clock instead.")