summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lange <jml@mumak.net>2016-02-14 12:59:55 +0000
committerJonathan Lange <jml@mumak.net>2016-02-14 12:59:55 +0000
commit725bfa9595bca9f4cd69caa21cde2d5b7b39399a (patch)
tree11f35e69297299d1466a65b5bba3faf8e9a726d4
parentc8d131d371ff20e1d6dadbf760a03f57f33d318b (diff)
downloadtesttools-725bfa9595bca9f4cd69caa21cde2d5b7b39399a.tar.gz
Fix example in docstring for `failed`
-rw-r--r--NEWS2
-rw-r--r--testtools/twistedsupport/_matchers.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index e0f15f2..53ebaa7 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ Improvements
* New ``Always`` and ``Never`` matchers. (Tristan Seligmann, #947026)
+* Fixed example in ``failed`` docstring. (Jonathan Lange, Github #208)
+
2.0.0
~~~~~
diff --git a/testtools/twistedsupport/_matchers.py b/testtools/twistedsupport/_matchers.py
index d617f89..99985e3 100644
--- a/testtools/twistedsupport/_matchers.py
+++ b/testtools/twistedsupport/_matchers.py
@@ -164,7 +164,8 @@ def failed(matcher):
For example::
error = RuntimeError('foo')
- fails_at_runtime = failed(Equals(error))
+ fails_at_runtime = failed(
+ AfterPreprocessing(lambda f: f.value, Equals(error)))
deferred = defer.fail(error)
assert_that(deferred, fails_at_runtime)