From 589b98b13bfe41a805f367c4d29b986f1575c153 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 5 May 2009 01:24:25 +0000 Subject: - Applications which rely on ``zope.testing.cleanup.cleanUp` in unit tests can still use that function indefinitely. However, for maximum forward compatibility, they should import ``cleanUp`` from ``repoze.bfg.testing`` instead of from ``zope.testing.cleanup``. The BFG paster templates and docs have been changed to use this function instead of the ``zope.testing.cleanup`` version. --- docs/narr/unittesting.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'docs/narr/unittesting.rst') diff --git a/docs/narr/unittesting.rst b/docs/narr/unittesting.rst index 34a0740e9..a0d2b551b 100644 --- a/docs/narr/unittesting.rst +++ b/docs/narr/unittesting.rst @@ -46,15 +46,14 @@ unittest TestCase that used the testing API. :linenos: import unittest - from zope.testing.cleanup import cleanUp from repoze.bfg import testing class MyTest(unittest.TestCase): def setUp(self): - cleanUp() + testing.cleanUp() def tearDown(self): - cleanUp() + testing.cleanUp() def test_view_fn_not_submitted(self): from my.package import view_fn @@ -106,7 +105,7 @@ assertion. We assert at the end of this that the renderer's ``say`` attribute is ``Yo``, as this is what is expected of the view function in the branch it's testing. -Note that the test calls the ``zope.testing.cleanup.cleanUp`` function +Note that the test calls the ``repoze.bfg.testing.cleanUp`` function in its ``setUp`` and ``tearDown`` functions. This is required to perform cleanup between the test runs. If you use any of the testing API, be sure to call this function at setup and teardown of individual -- cgit v1.2.3