mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 23:00:18 +00:00
Use the :pep: tag instead of directly linking PEPs
This commit is contained in:
@@ -16,7 +16,7 @@ Some general rules of testing:
|
||||
alone, and also within the test suite, regardless of the order they are called.
|
||||
The implication of this rule is that each test must be loaded with a fresh
|
||||
dataset and may have to do some cleanup afterwards. This is usually
|
||||
handled by setUp() and tearDown() methods.
|
||||
handled by `setUp()` and `tearDown()` methods.
|
||||
|
||||
- Try hard to make tests that run fast. If one single test needs more than a
|
||||
few millisecond to run, development will be slowed down or the tests will not
|
||||
@@ -287,7 +287,7 @@ always returns the same result (but only for the duration of the test).
|
||||
# not where the SearchForm class itself is imported from
|
||||
@mock.patch('myapp.SearchForm.search', mock_search)
|
||||
def test_new_watchlist_activities(self):
|
||||
# get_search_results runs a search and iterates over the result
|
||||
# get_search_results runs a search and iterates over the result
|
||||
self.assertEqual(len(myapp.get_search_results(q="fish")), 3)
|
||||
|
||||
Mock has many other ways you can configure it and control its behavior.
|
||||
|
||||
Reference in New Issue
Block a user