Skip to content

Commit

Permalink
Imported Upstream version 0.11.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ieure committed Jun 23, 2010
1 parent 85eef72 commit d722f3f
Show file tree
Hide file tree
Showing 68 changed files with 1,074 additions and 393 deletions.
36 changes: 35 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
0.11.3

- Fixed default plugin manager's use of plugin overriding. Thanks to
rob.daylife for the bug report and patch. (#323).

0.11.2

- Changed plugin loading so that external plugins loaded via extension
points can override builtin plugins with the same name.
- Updated multiprocess plugin and nose's packaging to allow multiprocess
plugin to work on Windows (#265).
- Fixed bug in xunit plugin's interaction with suites and errors in
module-level setup. Thanks to Mark McCague for the bug report (#279).
- Fixed bug in nose.loader.TestLoader that allowed Test classes that raise
exceptions in __init__ to crash the test run (#269).
- Fixed bugs in nose's test suite that caused spurious failures on Windows.
- Fixed bug in twisted tools: delayed calls were not shut down on
reactor stop. Thanks to abbeyj for the patch (#278).
- Fixed bug where root log handlers were not cleared. For example, this was
emitting unwanted messages when testing Google App Engine websites.
- Fixed bug in test names output by xunit plugin. Thanks to Philip
Jenvey for the bug report and patch (#280).
- Fixed bug in profile plugin that caused stats to fail to print under Python
2.5 and later. Thanks to djs at n-cube dot org for the bug report (#285).
- Improved logcapture filtering, with default setting to filter out log
messages from nose itself. Thanks to gfxmonk for the patch (#277).
- The xunit plugin now tags skipped tests with a <skipped> testcase tag, and
prevents the XML from containing invalid control characters.
- Updated nose to be compatible with python 2.7 (#305).
- Updated loading of usage document to allow nose to run from within
an egg archive (#288).
- Fixed IronPython checks to make nose compatible with more versions
of IronPython. Thanks to Kevin Mitchell for the patch (#316).

0.11.1

- Fixed bug in xunit plugin xml escaping. Thanks to Nat Williams for the bug
Expand All @@ -9,7 +43,7 @@
- Fixed bug in collect only plugin that caused it to fail when collecting from
test generators.
- Fixed some broken html in docs.

0.11

- Added multiprocess plugin that allows tests to be run in parallel
Expand Down
9 changes: 4 additions & 5 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
0.10.3
0.11.3
------

nose version 0.10.3 fixes a serious bug found in 0.10.2's nosetests
setuptools command, and updates the coverage plugin to be more
friendly to other plugins that trigger imports in begin(). Thanks to
Philip Jenvey and Ned Batchelder for reporting these issues.
nose version 0.11.3 fixes a method resolution order bug in 0.11.2 that
prevented plugin overriding from working correctly with the
DefaultPluginManager.
4 changes: 2 additions & 2 deletions PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Metadata-Version: 1.0
Name: nose
Version: 0.11.1
Version: 0.11.3
Summary: nose extends unittest to make testing easier
Home-page: http://somethingaboutorange.com/mrl/projects/nose/
Author: Jason Pellerin
Author-email: jpellerin+nose@gmail.com
License: GNU LGPL
Download-URL: http://somethingaboutorange.com/mrl/projects/nose/nose-0.11.1.tar.gz
Download-URL: http://somethingaboutorange.com/mrl/projects/nose/nose-0.11.3.tar.gz
Description: nose extends the test loading and running features of unittest, making
it easier to write, find and run tests.

Expand Down
18 changes: 11 additions & 7 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,20 @@ Configuration
-------------

In addition to passing command-line options, you may also put
configuration options in a .noserc or nose.cfg file in your home
directory. These are standard .ini-style config files. Put your
nosetests configuration in a [nosetests] section. Options are the same
as on the command line, with the -- prefix removed. For options that
are simple switches, you must supply a value:
configuration options in your project's *setup.cfg* file, or a .noserc
or nose.cfg file in your home directory. In any of these standard
.ini-style config files, you put your nosetests configuration in a
``[nosetests]`` section. Options are the same as on the command line,
with the -- prefix removed. For options that are simple switches, you
must supply a value:

[nosetests]
verbosity=3
with-doctest=1

All configuration files that are found will be loaded and their
options combined.
options combined. You can override the standard config file loading
with the ``-c`` option.


Using Plugins
Expand Down Expand Up @@ -297,7 +299,9 @@ Options
filter out needless output. Example: filter=foo will capture
statements issued ONLY to foo or foo.what.ever.sub but not foobar
or other logger. Specify multiple loggers with comma:
filter=foo,bar,baz. [NOSE_LOGFILTER]
filter=foo,bar,baz. If any logger name is prefixed with a minus, eg
filter=-foo, it will be excluded rather than included. Default:
exclude logging messages from nose itself (-nose). [NOSE_LOGFILTER]

--logging-clear-handlers

Expand Down
4 changes: 2 additions & 2 deletions doc/.templates/indexsidebar.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<h3><a href="/mrl/projects/nose/nose-{{ release }}.tar.gz">Download</a></h3>
<ul>
<li><a href="/mrl/projects/nose/nose-{{ release }}.tar.gz">
Current version: {{ version }}</a>
Current version: {{ release }}</a>
</li>
</ul>

<h3>Install</h3>
<ul>
<li>This release:<br/>
<tt>easy_install nose=={{ version }}</tt></li>
<tt>easy_install nose=={{ release }}</tt></li>
<li>Development (unstable):<br/>
<tt>easy_install nose==dev</tt>
</li>
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# The short X.Y version.
version = '0.11'
# The full version, including alpha/beta/rc tags.
release = '0.11.1'
release = '0.11.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions doc/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<html>
<head><title>Redirecting to nose 0.11 docs</title>
<meta http-equiv="refresh" content="0; ./0.11.1/"/>
<meta http-equiv="refresh" content="0; ./0.11.2/"/>
</head>
<body>
<p>Redirecting to <a href="./0.11.1/">nose 0.11 docs</a></p>
<p>Redirecting to <a href="./0.11.2/">nose 0.11 docs</a></p>
</body>
</html>
Binary file modified doc/manbuilder.pyc
Binary file not shown.
Binary file modified doc/manpage.pyc
Binary file not shown.
8 changes: 8 additions & 0 deletions doc/plugins/builtin.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Batteries included: builtin nose plugins
========================================

nose includes a number of builtin plugins that can make testing faster and easier.

.. note ::
nose 0.11.2 includes a change to default plugin loading. Now, a 3rd party
plugin with *the same name* as a builtin *will be loaded instead*
of the builtin plugin.
.. toctree ::
:maxdepth: 2
Expand Down
10 changes: 10 additions & 0 deletions doc/plugins/cover.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Cover: code coverage
====================

.. note ::
Newer versions of coverage contain their own nose plugin which is
superior to the builtin plugin. It exposes more of coverage's
options and uses coverage's native html output. Depending on the
version of coverage installed, the included plugin may override the
nose builtin plugin, or be available under a different name. Check
``nosetests --help`` or ``nosetests --plugins`` to find out which
coverage plugin is available on your system.
.. autoplugin :: nose.plugins.cover
7 changes: 7 additions & 0 deletions functional_tests/doc_tests/test_init_plugin/init_plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ raising any exceptions.
... def test_likes_cheese(self):
... """Widgets might like cheese"""
... self.widget.likes_cheese()
... def shortDescription(self): # 2.7 compat
... try:
... doc = self._testMethodDoc
... except AttributeError:
... # 2.4 compat
... doc = self._TestCase__testMethodDoc
... return doc and doc.split("\n")[0].strip() or None

The tests are bundled into a suite that we can pass to the test runner.

Expand Down
3 changes: 0 additions & 3 deletions functional_tests/doc_tests/test_multiprocess/multiprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ indeterminate.
First we have to reset all of the test modules.

>>> import sys
>>> sys.modules['test_shared'].called[:] = []
>>> sys.modules['test_not_shared'].called[:] = []
>>> sys.modules['test_can_split'].called[:] = []

Expand Down Expand Up @@ -218,7 +217,6 @@ runner processes as fixtures are re-executed.
We have to reset all of the test modules again.

>>> import sys
>>> sys.modules['test_shared'].called[:] = []
>>> sys.modules['test_not_shared'].called[:] = []
>>> sys.modules['test_can_split'].called[:] = []

Expand Down Expand Up @@ -270,4 +268,3 @@ are a few other differences that may impact your test suite:
use subprocess to launch another copy of nose that also uses the
multiprocess plugin. This is why this test is skipped under python 2.6 when
run with the ``--processes`` switch.

Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import sys
import os
from nose.plugins.skip import SkipTest
from nose.plugins.multiprocess import MultiProcess
from nose.plugins.plugintest import munge_nose_output_for_doctest

_multiprocess_can_split_ = True

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
import os
import sys
called = []

here = os.path.dirname(__file__)
flag = os.path.join(here, 'shared_flag')

_multiprocess_shared_ = 1

def _log(val):
ff = open(flag, 'a+')
ff.write(val)
ff.write("\n")
ff.close()


def _clear():
if os.path.isfile(flag):
os.unlink(flag)


def logged():
return [line for line in open(flag, 'r')]


def setup():
print >> sys.stderr, "setup called"
called.append('setup')
_log('setup')


def teardown():
print >> sys.stderr, "teardown called"
called.append('teardown')

_clear()


def test_a():
assert len(called) == 1, "len(%s) !=1" % called
assert len(logged()) == 1, "len(%s) !=1" % called


def test_b():
assert len(called) == 1, "len(%s) !=1" % called
assert len(logged()) == 1, "len(%s) !=1" % called


class TestMe:
Expand Down
4 changes: 2 additions & 2 deletions functional_tests/doc_tests/test_xunit_plugin/test_skips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Traceback (most recent call last):
AssertionError: bye
<BLANKLINE>
----------------------------------------------------------------------
XML: .../support/nosetests.xml
XML: ...nosetests.xml
----------------------------------------------------------------------
Ran 4 tests in ...s
<BLANKLINE>
FAILED (SKIP=1, errors=1, failures=1)

>>> open(outfile, 'r').read() # doctest: +ELLIPSIS
'<?xml version="1.0" encoding="UTF-8"?><testsuite name="nosetests" tests="4" errors="1" failures="1" skip="1"><testcase classname="test_skip" name="test_skip.test_ok" time="..." /><testcase classname="test_skip" name="test_skip.test_err" time="..."><error type="exceptions.Exception">.../error></testcase><testcase classname="test_skip" name="test_skip.test_fail" time="..."><failure type="exceptions.AssertionError">...</failure></testcase></testsuite>'
'<?xml version="1.0" encoding="UTF-8"?><testsuite name="nosetests" tests="4" errors="1" failures="1" skip="1"><testcase classname="test_skip" name="test_ok" time="..." /><testcase classname="test_skip" name="test_err" time="..."><error type="exceptions.Exception" message="oh no">...</error></testcase><testcase classname="test_skip" name="test_fail" time="..."><failure type="exceptions.AssertionError" message="bye">...</failure></testcase><testcase classname="test_skip" name="test_skip" time="..."><skipped type="nose.plugins.skip.SkipTest" message="not me">...</skipped></testcase></testsuite>'
5 changes: 5 additions & 0 deletions functional_tests/support/issue269/test_bad_class.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class TestCrashy(object):
def __init__(self):
raise Exception("pow")
def test_whatever(self):
pass
5 changes: 5 additions & 0 deletions functional_tests/support/issue279/test_mod_setup_fails.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def setup():
raise Exception("I would prefer not to")

def test():
raise Exception("I should never run")
4 changes: 4 additions & 0 deletions functional_tests/support/xunit/test_xunit_as_suite.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import sys
from nose.exc import SkipTest
import unittest
Expand All @@ -13,6 +14,9 @@ def test_fail(self):
def test_error(self):
raise TypeError("oops, wrong type")

def test_non_ascii_error(self):
raise Exception(u"日本")

def test_output(self):
sys.stdout.write("test-generated output\n")

Expand Down
3 changes: 2 additions & 1 deletion functional_tests/test_buggy_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from cStringIO import StringIO
from nose.core import TestProgram
from nose.config import Config
from nose.result import _TextTestResult

here = os.path.dirname(__file__)
support = os.path.join(here, 'support')


class TestRunner(unittest.TextTestRunner):
def _makeResult(self):
self.result = unittest._TextTestResult(
self.result = _TextTestResult(
self.stream, self.descriptions, self.verbosity)
return self.result

Expand Down
3 changes: 2 additions & 1 deletion functional_tests/test_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import unittest
import warnings
from cStringIO import StringIO
from nose.result import _TextTestResult
here = os.path.dirname(__file__)
support = os.path.join(here, 'support')


class TestRunner(unittest.TextTestRunner):
def _makeResult(self):
self.result = unittest._TextTestResult(
self.result = _TextTestResult(
self.stream, self.descriptions, self.verbosity)
return self.result

Expand Down
Loading

0 comments on commit d722f3f

Please sign in to comment.