--- nose-1.0.0.orig/unit_tests/test_result_proxy.py +++ nose-1.0.0/unit_tests/test_result_proxy.py @@ -159,6 +159,30 @@ case(proxy) assert proxy.shouldStop assert res.shouldStop - + + def test_coercion_of_custom_exception(self): + from nose.case import Test + + class CustomException(Exception): + def __init__(self, message, two, three): + Exception.__init__(self, message) + + class TC(unittest.TestCase): + def runTest(self): + pass + + test = TC() + case = Test(test) + res = unittest.TestResult() + try: + raise CustomException("the error", 2, 3) + except: + etype, val, tb = sys.exc_info() + val = str(val) # simulate plugin shenanigans + proxy = ResultProxy(res, test=case) + # Python 3 coercion should happen here without error + proxy.addError(test, (etype, val, tb)) + proxy.addFailure(test, (etype, val, tb)) + if __name__ == '__main__': unittest.main() --- nose-1.0.0.orig/debian/docs +++ nose-1.0.0/debian/docs @@ -0,0 +1,2 @@ +README.txt +build/sphinx/html/ --- nose-1.0.0.orig/debian/compat +++ nose-1.0.0/debian/compat @@ -0,0 +1 @@ +5 --- nose-1.0.0.orig/debian/manpages +++ nose-1.0.0/debian/manpages @@ -0,0 +1 @@ +nosetests.1 --- nose-1.0.0.orig/debian/watch +++ nose-1.0.0/debian/watch @@ -0,0 +1,4 @@ +version=3 +opts="downloadurlmangle=s|/([0-9.]+)/$|/nose-$1.tar.gz|,filenamemangle=s|.*/([0-9.]+)/|nose-$1.tar.gz|" \ + http://somethingaboutorange.com/mrl/projects/nose/ \ + ./([0-9.]+)/ --- nose-1.0.0.orig/debian/pyversions +++ nose-1.0.0/debian/pyversions @@ -0,0 +1 @@ +2.3- --- nose-1.0.0.orig/debian/copyright +++ nose-1.0.0/debian/copyright @@ -0,0 +1,27 @@ +This package was debianized by Gustavo Noronha Silva on +Sun, 07 May 2006 22:54:10 -0300. + +It was downloaded from http://somethingaboutorange.com/mrl/projects/nose/ + +Copyright: + +Copyright (C) 2005-2006 Jason Pellerin + +License: + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + On Debian systems, the LGPL version 2 license can be found at + /usr/share/common-licenses/LGPL-2. --- nose-1.0.0.orig/debian/changelog +++ nose-1.0.0/debian/changelog @@ -0,0 +1,175 @@ +nose (1.0.0-1ubuntu1~openstack~maverick1) maverick; urgency=low + + * Backported for OpenStack for maverick + + -- Monty Taylor Fri, 09 Sep 2011 10:01:42 -0700 + +nose (1.0.0-1ubuntu1) oneiric; urgency=low + + * nose/proxy.py, unit_tests/test_result_proxy.py: Fixes mishandling + of custom exceptions during failures. Changes based on upstream + commit:b3cdbd839e78 and will be part of 1.0.1 release. (LP: #814208) + + -- Dave Walker (Daviey) Thu, 21 Jul 2011 19:04:28 +0100 + +nose (1.0.0-1) unstable; urgency=low + + * Team upload. + + [ Jakub Wilk ] + * Fix watch file. + + [ Piotr Ożarowski ] + * New upstream release (closes: #608677) + - adds Python 2.7 (closes: #608679) + * Remove build dir in clean target + + -- Piotr Ożarowski Sun, 17 Apr 2011 22:13:12 +0200 + +nose (0.11.1-1) unstable; urgency=low + + * New upstream release + * Documentation is now included + * debian/control + - build-depend on python-sphinx + - bump build-dependency on python-dev to >= 2.5.4-1~ + - bump standards to 3.8.1, no changes necessary + - added dependency to libjs-jquery + * debian/rules + - addded --install-layout=deb to DEB_PYTHON_INSTALL_ARGS + - build the documentation using Sphinx + * debian/doc-base + - added doc-base file to register documentation + + -- Torsten Marek Sun, 17 May 2009 12:32:32 +0200 + +nose (0.10.4-2) unstable; urgency=low + + [ Stephan Peijnik ] + * Upload to unstable + * Added misc:Depends to fix lintian warning + + -- Debian Python Modules Team Wed, 18 Feb 2009 08:48:35 +0100 + +nose (0.10.4-1) experimental; urgency=low + + [ Sandro Tosi ] + * debian/control + - switch Vcs-Browser field to viewsvn + + [ Piotr Ożarowski ] + * New upstream release + + -- Debian Python Modules Team Thu, 06 Nov 2008 19:50:27 +0100 + +nose (0.10.3-1) unstable; urgency=low + + [Torsten Marek] + * New upstream release (Closes: #461994) + * debian/control + - bump standards version to 3.8.0, no changes necessary + - add suggestions for python-coverage (Closes: #457053) + - change dependency on python-setuptools into + python-pkg-resources (Closes: #468719) + - added myself to uploaders + + [Gustavo Noronha Silva] + * debian/control: + - remove -1 from build-dep on setuptools + + -- Torsten Marek Thu, 12 Jun 2008 13:39:43 +0200 + +nose (0.10.1-1) unstable; urgency=low + + [ Sandro Tosi ] + * debian/control + - uniforming Vcs-Browser field + + [ Ondrej Certik ] + * New upstream release + * Standards version upgraded to 3.7.3 + + -- Gustavo Noronha Silva Sun, 10 Feb 2008 22:27:38 -0200 + +nose (0.10.0-1) unstable; urgency=low + + [ Piotr Ożarowski ] + * Vcs-Browser and Homepage fields added + * XS-Vcs-Svn field renamed to Vcs-Svn + + [ Gustavo Noronha Silva ] + * New upstream release (Closes: #449072) + + -- Gustavo Noronha Silva Sat, 17 Nov 2007 03:31:08 -0200 + +nose (0.9.3-1) unstable; urgency=low + + * New upstream release + + -- Gustavo Noronha Silva Wed, 27 Jun 2007 20:57:42 -0300 + +nose (0.9.2-3) unstable; urgency=low + + [ Piotr Ożarowski ] + * New python-support handles egg's directory name correctly + - bump python-support required version + - remove mv part from debian/rules + (Closes: #423978) + + -- Gustavo Noronha Silva Sat, 19 May 2007 17:22:13 -0300 + +nose (0.9.2-2) unstable; urgency=low + + * Uploading to unstable + + -- Gustavo Noronha Silva Sun, 15 Apr 2007 14:28:01 -0300 + +nose (0.9.2-1) experimental; urgency=low + + * New upstream release + * debian/rules: + - remove the incorrect path in which upstream is installing + the manpage + * debian/manpages, debian/nosetests.1: + - have the upstream manpage be installed, instead of the one I provide + (it is the one upstream is providing now, but updated) + + -- Gustavo Noronha Silva Thu, 15 Feb 2007 00:30:17 -0200 + +nose (0.9.1-1) experimental; urgency=low + + [ Piotr Ozarowski ] + * New upstream release + * debian/control: + - moved python-dev to Build-Depends: (to satisfy lintian) + - added XS-Vcs-Svn field + * debian/rules: + - simplified a little bit (`pyversions -vd' instead of sed) + * Added debian/watch file + * Bumped debhelper compatibility from 4 to 5 + + -- Gustavo Noronha Silva Sat, 13 Jan 2007 19:52:32 -0200 + +nose (0.9.0-2) unstable; urgency=low + + * debian/control: + - added python-setuptools to Depends (Closes: #395287) + - added XS-Python-Version + * debian/docs: + - added, now install README.txt documentation (addresses #395289) + * debian/examples: + - added; install the examples provided, as well + * debian/nosetests.1, debian/manpages: + - added; manpage generated by help2man and adapted to add some important + information (Closes: #395289) + + -- Gustavo Noronha Silva Thu, 26 Oct 2006 22:47:27 -0300 + +nose (0.9.0-1) unstable; urgency=low + + * Initial Release (Closes: #366786) + - thanks to Arnaud Fontaine for implementing the new + python policy + + -- Gustavo Noronha Silva Sun, 7 May 2006 22:49:58 -0300 + --- nose-1.0.0.orig/debian/examples +++ nose-1.0.0/debian/examples @@ -0,0 +1 @@ +examples/* --- nose-1.0.0.orig/debian/doc-base +++ nose-1.0.0/debian/doc-base @@ -0,0 +1,13 @@ +Document: nose +Title: Unit Testing Extensions for Python +Author: Phil Thompson +Abstract: Unit Testing Extensions for Python + This is the documentation for nose, an extension of the + Python unittest framework that supports simple test + collection, a simplified API for writing tests + and many useful plugins. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/python-nose/html/index.html +Files: /usr/share/doc/python-nose/html/*.html --- nose-1.0.0.orig/debian/links +++ nose-1.0.0/debian/links @@ -0,0 +1 @@ +usr/share/javascript/jquery/jquery.js usr/share/doc/python-nose/html/_static/jquery.js --- nose-1.0.0.orig/debian/control +++ nose-1.0.0/debian/control @@ -0,0 +1,20 @@ +Source: nose +Section: python +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Gustavo Noronha Silva +Uploaders: Debian Python Modules Team , Torsten Marek +Build-Depends: python (>= 2.5.4-1~), python-setuptools (>= 0.6a9), debhelper (>= 5.0.38), cdbs (>= 0.4.49), python-support (>= 0.8.1), python-sphinx (>= 0.6.1), libjs-jquery +Homepage: http://somethingaboutorange.com/mrl/projects/nose/ +Vcs-Svn: svn://svn.debian.org/python-modules/packages/nose/trunk/ +Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/nose/trunk/ +Standards-Version: 3.8.1 + +Package: python-nose +Architecture: all +Depends: ${python:Depends}, python-pkg-resources, ${misc:Depends} +Suggests: python-coverage +Description: test discovery and running for Python's unittest + nose provides an alternate test discovery and running process for + unittest, one that is intended to mimic the behavior of py.test as + much as is reasonably possible without resorting to too much magic --- nose-1.0.0.orig/debian/rules +++ nose-1.0.0/debian/rules @@ -0,0 +1,21 @@ +#!/usr/bin/make -f + +DEB_PYTHON_SYSTEM=pysupport +DEB_COMPRESS_EXCLUDE= .js .inv + +include /usr/share/cdbs/1/rules/buildcore.mk +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/python-distutils.mk + +DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed --install-layout=deb + +common-build-indep/$(DEB_PYTHON_MODULE_PACKAGES):: + python setup.py build_sphinx + +binary-post-install/python-nose:: + # the manpage is already being installed at the correct place + # remove the incorrect path + rm -rf debian/python-nose/usr/man + +clean:: + rm -rf build --- nose-1.0.0.orig/debian/source/format +++ nose-1.0.0/debian/source/format @@ -0,0 +1 @@ +1.0 --- nose-1.0.0.orig/nose/proxy.py +++ nose-1.0.0/nose/proxy.py @@ -85,6 +85,19 @@ def __repr__(self): return repr(self.result) + def _prepareErr(self, err): + if not isinstance(err[1], Exception): + # Turn value back into an Exception (required in Python 3.x). + # Plugins do all sorts of crazy things with exception values. + try: + # The actual exception class is needed for failure detail + # but maybe other plugins? + value = err[0](err[1]) + except: + value = Exception(err[1]) + err = (err[0], value, err[2]) + return err + def assertMyTest(self, test): # The test I was called with must be my .test or my # .test's .test. or my .test.test's .case @@ -117,12 +130,9 @@ # test.passed is set in result, to account for error classes formatted = plugins.formatError(self.test, err) if formatted is not None: - if isinstance(formatted[1], basestring): - # Turn it back into an Exception (required in Python 3.x) - formatted = (formatted[0], Exception(formatted[1]), formatted[2]) err = formatted plugins.addError(self.test, err) - self.result.addError(self.test, err) + self.result.addError(self.test, self._prepareErr(err)) if not self.result.wasSuccessful() and self.config.stopOnError: self.shouldStop = True @@ -136,10 +146,8 @@ formatted = plugins.formatFailure(self.test, err) if formatted is not None: err = formatted - if not isinstance(err[1], Exception): - err = (err[0], err[0](err[1]), err[2]) plugins.addFailure(self.test, err) - self.result.addFailure(self.test, err) + self.result.addFailure(self.test, self._prepareErr(err)) if self.config.stopOnError: self.shouldStop = True @@ -178,4 +186,3 @@ """Tests that failed""") testsRun = proxied_attribute('result', 'testsRun', """Number of tests run""") -