diff options
| author | Sergey Shepelev <temotor@gmail.com> | 2014-07-16 13:54:42 +0400 |
|---|---|---|
| committer | Sergey Shepelev <temotor@gmail.com> | 2014-07-16 15:15:50 +0400 |
| commit | a651a3097f7ba957ad29342dac011d5a9218e76b (patch) | |
| tree | 1d467489bf53248ce285a8162573d14c274544e4 /tests/timeout_test.py | |
| parent | d2ec34fb1453e032682ddabd77ec17738a6a4e7f (diff) | |
| download | eventlet-a651a3097f7ba957ad29342dac011d5a9218e76b.tar.gz | |
tests: deprecated TestCase.assert_() -> assert keyword
https://github.com/eventlet/eventlet/issues/101
Diffstat (limited to 'tests/timeout_test.py')
| -rw-r--r-- | tests/timeout_test.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/timeout_test.py b/tests/timeout_test.py index d0865a8..d58bf5a 100644 --- a/tests/timeout_test.py +++ b/tests/timeout_test.py @@ -17,7 +17,7 @@ class TestDirectRaise(LimitedTestCase): except timeout.Timeout as t: assert tm is t, (tm, t) assert not t.pending, repr(t) - + def test_repr(self): # just verify these don't crash tm = timeout.Timeout(1) @@ -37,18 +37,17 @@ class TestWithTimeout(LimitedTestCase): self.assertRaises(timeout.Timeout, timeout.with_timeout, DELAY, greenthread.sleep, DELAY*10) X = object() r = timeout.with_timeout(DELAY, greenthread.sleep, DELAY*10, timeout_value=X) - self.assert_(r is X, (r, X)) - r = timeout.with_timeout(DELAY*10, greenthread.sleep, + assert r is X, (r, X) + r = timeout.with_timeout(DELAY*10, greenthread.sleep, DELAY, timeout_value=X) - self.assert_(r is None, r) + assert r is None, r def test_with_outer_timer(self): def longer_timeout(): # this should not catch the outer timeout's exception - return timeout.with_timeout(DELAY * 10, + return timeout.with_timeout(DELAY * 10, greenthread.sleep, DELAY * 20, timeout_value='b') self.assertRaises(timeout.Timeout, timeout.with_timeout, DELAY, longer_timeout) -
\ No newline at end of file |
