Merge lp:~lifeless/launchpad/zope.testing into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Robert Collins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11814 |
Proposed branch: | lp:~lifeless/launchpad/zope.testing |
Merge into: | lp:launchpad |
Diff against target: |
144 lines (+4/-48) 2 files modified
lib/canonical/testing/layers.py (+0/-45) versions.cfg (+4/-3) |
To merge this branch: | bzr merge lp:~lifeless/launchpad/zope.testing |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Lange (community) | Approve | ||
Review via email: mp+39423@code.launchpad.net |
Commit message
[r=jml]Fix layers to teardown always not just sometimes, fixing teardown in our code base and freeing us from the tyranny of atexit.
Description of the change
Fix layers to teardown always not just sometimes, fixing teardown in our code base and freeing us from the tyranny of atexit.
This is the diff to zope.testing:
diff -rup zope.testing-
--- zope.testing-
+++ zope.testing-
@@ -85,7 +85,7 @@ long_description=(
setup(
name=
- version = '3.9.4-p2',
+ version = '3.9.4-p3',
url='http://
license='ZPL 2.1',
descriptio
Only in zope.testing-
diff -rup zope.testing-
--- zope.testing-
+++ zope.testing-
@@ -606,6 +606,22 @@ def tear_down_
except NotImplementedE
if not optional:
+ # Unwind all layers without mangling setup_layers - the runner
+ # will start a new process.
+ unneeded = [togo for togo in setup_layers if togo is not l]
+ unneeded = order_by_
+ unneeded.reverse()
+ for to_clean in unneeded:
+ output.
+ t = time.time()
+ tear_down = getattr(to_clean, 'tearDown', None)
+ if tear_down:
+ try:
+ tear_down()
+ except NotImplementedE
+ output.
+ else:
+ output.
else:
Only in zope.testing-
diff -rup zope.testing-
--- zope.testing-
+++ zope.testing-
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: zope.testing
-Version: 3.9.4-p2
+Version: 3.9.4-p3
Summary: Zope testing framework, including the testrunner script.
Home-page: http://
Author: Zope Foundation and Contributors
On Wed, Oct 27, 2010 at 12:36 AM, Robert Collins reviewers)
<email address hidden> wrote:
> Robert Collins has proposed merging lp:~lifeless/launchpad/zope.testing into lp:launchpad/devel.
>
> Requested reviews:
> Launchpad code reviewers (launchpad-
>
>
> Fix layers to teardown always not just sometimes, fixing teardown in our code base and freeing us from the tyranny of atexit.
>
> This is the diff to zope.testing:
>
Hey Rob,
I'd be much more comfortable if the change to zope.testing had tests,
even the crappy doctests that zope.testing uses. As far as I can tell
it looks correct, but that's not worth a lot. It's also unfortunate
that the layer tearDown logic is duplicated.
I'm not sure how much to insist on these changes, since our aim is to
move away from layers and zope.testing completely. If we fail in our
aims, or if we get delayed, then we will probably regret not testing
this code.
The changes to Launchpad itself look good.
jml
> diff -rup zope.testing- 3.9.4-p2/ setup.py zope.testing- 3.9.4-p3/ setup.py 3.9.4-p2/ setup.py 2010-10-21 13:14:02.000000000 +1100 3.9.4-p3/ setup.py 2010-10-27 14:07:33.574856366 +1100 testing' , pypi.python. org/pypi/ zope.testing', 3.9.4-p3: setup.py~ 3.9.4-p2/ src/zope/ testing/ testrunner/ runner. py zope.testing- 3.9.4-p3/ src/zope/ testing/ testrunner/ runner. py 3.9.4-p2/ src/zope/ testing/ testrunner/ runner. py 2010-06-08 02:05:10.000000000 +1000 3.9.4-p3/ src/zope/ testing/ testrunner/ runner. py 2010-10-27 15:09:31.956110181 +1100 unneeded( options, needed, rror: tear_down_ not_supported( ) bases(unneeded) start_tear_ down(name_ from_layer( to_clean) ) rror: tear_down_ not_supported( ) stop_tear_ down(time. time() - t) stop_tear_ down(time. time() - t)
> --- zope.testing-
> +++ zope.testing-
> @@ -85,7 +85,7 @@ long_description=(
>
> setup(
> name='zope.
> - version = '3.9.4-p2',
> + version = '3.9.4-p3',
> url='http://
> license='ZPL 2.1',
> description='Zope testing framework, including the testrunner script.',
> Only in zope.testing-
> diff -rup zope.testing-
> --- zope.testing-
> +++ zope.testing-
> @@ -606,6 +606,22 @@ def tear_down_
> except NotImplementedE
> output.
> if not optional:
> + # Unwind all layers without mangling setup_layers - the runner
> + # will start a new process.
> + unneeded = [togo for togo in setup_layers if togo is not l]
> + unneeded = order_by_
> + unneeded.reverse()
> + for to_clean in unneeded:
> + output.
> + t = time.time()
> + tear_down = getattr(to_clean, 'tearDown', None)
> + if tear_down:
> + try:
> + tear_down()
> + except NotImplementedE
> + output.
> + else:
> + output.
> raise CanNotTearDown(l)
> else:
> output.
> Only in zope.testing- 3.9.4-p3/ src/zope/ testing/ testrunner: runner.py~ 3.9.4-p2/ src/zope. testing. egg-info/ PKG-INFO zope.testing- 3.9.4-p3/ src/zope. testing. ..
> diff -rup zope.testing-