Permalink
Browse files

Merge branch 'master' of github.com:jml/testtools into git-not-bzr

Conflicts:
	MANIFEST.in
  • Loading branch information...
2 parents eb26383 + 959d381 commit 435f56b07c40bd01fd05343675758737a081da29 @jml jml committed Jan 31, 2013
Showing with 17 additions and 10 deletions.
  1. +1 −1 MANIFEST.in
  2. +1 −1 Makefile
  3. +1 −1 NEWS
  4. 0 README → README.rst
  5. +5 −1 doc/for-test-authors.rst
  6. +1 −1 doc/hacking.rst
  7. +6 −4 testtools/matchers/_higherorder.py
  8. +2 −1 testtools/tests/__init__.py
View
@@ -2,7 +2,7 @@ include LICENSE
include Makefile
include MANIFEST.in
include NEWS
-include README
+include README.rst
include .gitignore
graft doc
graft doc/_static
View
@@ -1,4 +1,4 @@
-# See README for copyright and licensing details.
+# Copyright (c) 2008-2013 testtools developers. See LICENSE for details.
PYTHON=python
SOURCES=$(shell find testtools -name "*.py")
View
2 NEWS
@@ -260,7 +260,7 @@ Improvements
* API documentation corrections. (Raphaël Badin)
* ``ConcurrentTestSuite`` now takes an optional ``wrap_result`` parameter
- that can be used to wrap the ``ThreadsafeForwardingResult``s created by
+ that can be used to wrap the ``ThreadsafeForwardingResults`` created by
the suite. (Jonathan Lange)
* ``Tagger`` added. It's a new ``TestResult`` that tags all tests sent to
View
File renamed without changes.
View
@@ -524,10 +524,14 @@ file against an arbitrary matcher::
HasLength
~~~~~~~~~
-Check the length of a collection. For example::
+Check the length of a collection. The following assertion will fail::
self.assertThat([1, 2, 3], HasLength(2))
+But this one won't::
+
+ self.assertThat([1, 2, 3], HasLength(3))
+
HasPermissions
~~~~~~~~~~~~~~
View
@@ -63,7 +63,7 @@ Source layout
-------------
The top-level directory contains the ``testtools/`` package directory, and
-miscellaneous files like ``README`` and ``setup.py``.
+miscellaneous files like ``README.rst`` and ``setup.py``.
The ``testtools/`` directory is the Python package itself. It is separated
into submodules for internal clarity, but all public APIs should be “promoted”
@@ -298,6 +298,7 @@ def MatchesPredicateWithParams(predicate, message, name=None):
HasLength = MatchesPredicate(
lambda x, y: len(x) == y, 'len({0}) is not {1}')
+ # This assertion will fail, as 'len([1, 2]) == 3' is False.
self.assertThat([1, 2], HasLength(3))
Note that unlike MatchesPredicate MatchesPredicateWithParams returns a
@@ -325,12 +326,13 @@ def __init__(self, predicate, message, name, *args, **kwargs):
"""Create a ``MatchesPredicateWithParams`` matcher.
:param predicate: A function that takes an object to match and
- additional params as given in *args and **kwargs. The result of the
- function will be interpreted as a boolean to determine a match.
+ additional params as given in ``*args`` and ``**kwargs``. The
+ result of the function will be interpreted as a boolean to
+ determine a match.
:param message: A message to describe a mismatch. It will be formatted
with .format() and be given a tuple containing whatever was passed
- to ``match()`` + *args in *args, and whatever was passed to
- **kwargs as its **kwargs.
+ to ``match()`` + ``*args`` in ``*args``, and whatever was passed to
+ ``**kwargs`` as its ``**kwargs``.
For instance, to format a single parameter::
@@ -1,6 +1,7 @@
+# Copyright (c) 2008-2013 testtools developers. See LICENSE for details.
+
"""Tests for testtools itself."""
-# See README for copyright and licensing details.
from unittest import TestSuite

0 comments on commit 435f56b

Please sign in to comment.