Remove newline in url that broke the link in the docs.

Fix syntax error in docs example.

Remove conflict marker remains from previous conflict.

Remove trailing whitespace from source example in docs

Resolve syntax errors in doc sample code.
This commit is contained in:
Christopher Lee
2014-08-18 14:48:30 +12:00
parent ed4f07be19
commit ad077be757
3 changed files with 11 additions and 12 deletions

View File

@@ -305,7 +305,6 @@ function in ``testtools.assertions`` This behaves like the method version does::
assert_that(result, Not(Equals(50))) assert_that(result, Not(Equals(50)))
=======
Delayed Assertions Delayed Assertions
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
@@ -463,7 +462,7 @@ example::
except RuntimeError: except RuntimeError:
exc_info = sys.exc_info() exc_info = sys.exc_info()
self.assertThat(exc_info, MatchesException(RuntimeError)) self.assertThat(exc_info, MatchesException(RuntimeError))
self.assertThat(exc_info, MatchesException(RuntimeError('bar')) self.assertThat(exc_info, MatchesException(RuntimeError('bar')))
Most of the time, you will want to uses `The raises helper`_ instead. Most of the time, you will want to uses `The raises helper`_ instead.
@@ -653,7 +652,7 @@ Used to add custom notes to a matcher. For example::
def test_annotate_example(self): def test_annotate_example(self):
result = 43 result = 43
self.assertThat( self.assertThat(
result, Annotate("Not the answer to the Question!", Equals(42)) result, Annotate("Not the answer to the Question!", Equals(42)))
Since the annotation is only ever displayed when there is a mismatch Since the annotation is only ever displayed when there is a mismatch
(e.g. when ``result`` does not equal 42), it's a good idea to phrase the note (e.g. when ``result`` does not equal 42), it's a good idea to phrase the note
@@ -866,7 +865,7 @@ matcher based on it::
divisible, '{0} is not divisible by {1}') divisible, '{0} is not divisible by {1}')
self.assertThat(7, IsDivisibleBy(1)) self.assertThat(7, IsDivisibleBy(1))
self.assertThat(7, IsDivisibleBy(7)) self.assertThat(7, IsDivisibleBy(7))
self.assertThat(7, IsDivisibleBy(2))) self.assertThat(7, IsDivisibleBy(2))
# This will fail. # This will fail.
Which will produce the error message:: Which will produce the error message::
@@ -1399,7 +1398,7 @@ id and can be used when filtering tests by id. (e.g. via ``--load-list``)::
def test_one(self): def test_one(self):
pass pass
@attr('more', 'than', 'one) @attr('more', 'than', 'one')
def test_two(self): def test_two(self):
pass pass

View File

@@ -93,10 +93,10 @@ Tests belong in ``testtools/tests/``.
Committing to trunk Committing to trunk
------------------- -------------------
Testtools is maintained using git, with its master repo at https://github.com Testtools is maintained using git, with its master repo at
/testing-cabal/testtools. This gives every contributor the ability to commit https://github.com/testing-cabal/testtools. This gives every contributor the
their work to their own branches. However permission must be granted to allow ability to commit their work to their own branches. However permission must be
contributors to commit to the trunk branch. granted to allow contributors to commit to the trunk branch.
Commit access to trunk is obtained by joining the `testing-cabal`_, either as an Commit access to trunk is obtained by joining the `testing-cabal`_, either as an
Owner or a Committer. Commit access is contingent on obeying the testtools Owner or a Committer. Commit access is contingent on obeying the testtools

View File

@@ -26,7 +26,7 @@ What better way to start than with a contrived code snippet?::
def attach_log_file(self): def attach_log_file(self):
self.addDetail( self.addDetail(
'log-file', 'log-file',
Content(UTF8_TEXT Content(UTF8_TEXT,
lambda: open(self.server.logfile, 'r').readlines())) lambda: open(self.server.logfile, 'r').readlines()))
def test_server_is_cool(self): def test_server_is_cool(self):