summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Pellerin <jpellerin@gmail.com>2007-04-24 04:27:31 +0000
committerJason Pellerin <jpellerin@gmail.com>2007-04-24 04:27:31 +0000
commit984bf51c327831a5c5a6807523be03ae56d8482a (patch)
tree3fa2f1f43084c0cfc9cf23b59789043be104c7b7
parentccb4cd753ac7b9af614e053de2729386e49a455f (diff)
downloadnose-984bf51c327831a5c5a6807523be03ae56d8482a.tar.gz
MERGE trunk r10:r196 into 0.10-dev branch: some tests now fail
-rw-r--r--CHANGELOG51
-rw-r--r--MANIFEST.in3
-rw-r--r--NEWS27
-rw-r--r--README.txt2
-rw-r--r--index.html.tpl46
-rw-r--r--nose/__init__.py156
-rw-r--r--nose/commands.py1
-rw-r--r--nose/core.py25
-rw-r--r--nose/importer.py2
-rw-r--r--nose/loader.py2
-rw-r--r--nose/plugins/__init__.py80
-rw-r--r--nose/plugins/attrib.py31
-rw-r--r--nose/plugins/base.py16
-rw-r--r--nose/plugins/cover.py1
-rw-r--r--nose/plugins/doctests.py39
-rw-r--r--nose/plugins/prof.py30
-rw-r--r--nose/proxy.py88
-rw-r--r--nose/selector.py5
-rw-r--r--nose/suite.py8
-rw-r--r--nose/tools.py26
-rw-r--r--nosetests.1247
-rwxr-xr-xscripts/mkindex.py6
-rwxr-xr-xscripts/mkrelease.py19
-rwxr-xr-xscripts/mkwiki.py316
-rw-r--r--scripts/rst2wiki.py125
-rw-r--r--setup.cfg3
-rw-r--r--setup.py39
-rw-r--r--tickets.csv115
-rw-r--r--tickets.rss7578
-rw-r--r--unit_tests/support/doctest/err_doctests.py12
-rw-r--r--unit_tests/support/doctest/no_doctests.py9
-rw-r--r--unit_tests/support/issue006/tests.py19
-rw-r--r--unit_tests/test_config.py3
-rw-r--r--unit_tests/test_doctest_error_handling.py46
-rw-r--r--unit_tests/test_issue_006.py31
-rw-r--r--unit_tests/test_plugins.py46
-rw-r--r--unit_tests/test_tools.py59
-rw-r--r--unit_tests/test_twisted.py39
-rw-r--r--unit_tests/test_twisted_testcase.py6
39 files changed, 9024 insertions, 333 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 762723a..45e1758 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,14 +1,59 @@
+0.9.3
+
+- Added support for user configuration files. Thanks to Antoine Pitrou for the
+ patch.
+- Fixed bug that caused profiler plugin to leak 0-byte temp files. Thanks to
+ Antoine Pitrou for the patch.
+- Made usage of temp files in profiler plugin more sensible. Thanks to Michael
+ Sclenker for the bug report.
+- Fixed bug that stopped loading of twisted TestCase tests. Thanks to Kumar
+ McMillan for the bug report.
+- Corrected man page location. Thanks to luke macken for the bug report and
+ patch.
+- Added with_setup to nose.tools.__all__. Thanks to Allen Bierbaum for the bug
+ report.
+- Altered plugin loading so that builtin plugins can be loaded without
+ setuptools. Thanks to Allen Bierbaum for the suggestion.
+- Fixed a bug in the doctests plugin that caused an error when multiple
+ exclude arguments were specified. Thanks to mbeachy for the bug report and
+ patch.
+
0.9.2
+- Added nosetests setuptools command. Now you can run python setup.py
+ nosetests and have access to all nose features and plugins. Thanks to James
+ Casbon for the patch.
- Added make_decorator function to nose.tools. Used to construct decorator
functions that are well-behaved and preserve as much of the original
function's metadata as possible. Thanks to Antoine Pitrou for the patch.
- Added nose.twistedtools, contributed by Antoine Pitrou. This module adds
@deferred decorator that makes it simple to write deferred tests, with or
without timeouts.
-- Added nosetests setuptools command. Now you can run python setup.py
- nosetests and have access to all nose features and plugins. Thanks to James
- Casbon for the patch.
+- Added monkeypatch to doctests that keeps doctest from stepping on coverage
+ when the two plugins are used together. Thanks to David Avraamides for the
+ bug report.
+- Added isolation plugin. Use this plugin to automatically restore sys.modules
+ after each test module or package. Thanks to Michal Kwiatkowski for the
+ feature request.
+- Fixed bug where -vvvv turned off verbose logging instead of making it even
+ more verbose. Thanks to Ian Bicking for the bug report.
+- Fixed bug where assert inspection would fail when the trailing """ of a
+ docstring was one of the inspected lines. Thanks to cito at online dot de
+ for the bug report.
+- Updated attrib plugin to allow selection of test methods by attributes of
+ the test case class. Thanks to Jason Hildebrand for the patch.
+- Improved compatibility with python 2.2. Thanks to Chad Whitacre for the
+ patch.
+- Fixed bug in handling of options from setup.cfg. Thanks to Kumar McMillan for
+ the patch.
+- Fixed bug in generator methods, where a generator method using an inline
+ funciton would result in an AttributeError. Thanks to Antoine Pitrou for the
+ bug report.
+- Updated coverage plugin to ignore lines tagged with #pragma: no cover,
+ matching the behavior of coverage.py on the command line. Thanks to Bill
+ Zingler for the bug report.
+- Added a man page for nosetests. Thanks to Gustavo Noronha Silva for the
+ request and providing an example.
0.9.1
diff --git a/MANIFEST.in b/MANIFEST.in
index 7f6cbd7..cab3dbb 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -7,4 +7,5 @@ include unit_tests/*/*/*/*/*.py
include CHANGELOG
include NEWS
include README.txt
-include lgpl.txt \ No newline at end of file
+include lgpl.txt
+include nosetests.1 \ No newline at end of file
diff --git a/NEWS b/NEWS
index 4ec2e97..ab1c979 100644
--- a/NEWS
+++ b/NEWS
@@ -1,19 +1,16 @@
-New in version 0.9.1
+New in version 0.9.3
--------------------
-Nose 0.9.1 is mainly a bug-fix release, but it does contain a few new
-features.
+nose 0.9.3 is mainly a bugfix release. The one new feature is support for user
+configuration files: now you can put your frequently used configuration
+options in .noserc or nose.cfg files, rather than typing them over and over
+and over again. Many thanks to Antoine Pitrou for that patch, and thanks to
+all of the other users who reported bugs and submitted patches and
+suggestions.
-* The --where (-w), --include and --exclude arguments may now all appear
- multiple times in a single command line, allowing easier running of
- multiple test suites and test suites with more diverse layouts.
-* For programmatic use, nose.runmodule() was added. Similar to
- doctest.runmodule() and unittest.main(), nose.runmodule() will load and run
- tests in the current module, which defaults to __main__.
-* A number of changes to plugins and plugin hooks make current plugins work
- better and allow more interesting plugins to be written.
+Barring catastrophic bugs, this will be the last release of nose in the 0.9
+series. An alpha release of nose 0.10 should be forthcoming within a few
+weeks. Details about the new features and architecture changes in nose 0.10
+may be found here_.
-Just about everything in this release was driven by requests from
-users. Thanks to the many folks who filed bug reports and suggested features,
-ideas and solutions to thorny problems.
- \ No newline at end of file
+.. _here: http://code.google.com/p/python-nose/wiki/VersionZeroTen
diff --git a/README.txt b/README.txt
index ed59869..36d903a 100644
--- a/README.txt
+++ b/README.txt
@@ -30,7 +30,7 @@ understand and hack. Other goals include:
interact with tests more easily.
This involves some major changes to how nose loads and runs tests.
-
+
Changes to loading
==================
diff --git a/index.html.tpl b/index.html.tpl
index 235f8ca..22d1b00 100644
--- a/index.html.tpl
+++ b/index.html.tpl
@@ -125,6 +125,11 @@
margin-bottom: 0px;
}
+ p.note {
+ background: #fed;
+ border: 1px solid black;
+ padding: 6px;
+ }
</style>
</head>
<body>
@@ -157,11 +162,11 @@
<p>Sign up to receive email announcements
of new releases</p>
- <h2><a href="http://nose.python-hosting.com/">Trac</a></h2>
+ <h2><a href="http://code.google.com/p/python-nose/">Tracker</a></h2>
<p>Report bugs, request features, wik the wiki, browse source.</p>
<h2>Get the code</h2>
- <p><tt>svn co http://svn.nose.python-hosting.com/trunk</tt></p>
+ <p><tt>svn co http://python-nose.googlecode.com/svn/trunk/ nose</tt></p>
<h2>Other links</h2>
<ul>
@@ -191,6 +196,11 @@
<h2>Install</h2>
+ <p class="note">
+ On most UNIX-like systems, you'll probably need to run these commands
+ as root or using sudo.
+ </p>
+
<p>Install nose using setuptools:
<pre>easy_install nose</pre>
</p>
@@ -201,14 +211,27 @@
<pre>python setup.py install</pre>
</p>
-
- %(body)s
- <h2><a name="tools"></a>nose.tools</h2>
+ <p>If you have an older version of setuptools installed, you may see an
+ error like this:
+
+ <blockquote>
+ <tt>The required version of setuptools (>=0.6c5) is not available, and
+ can't be installed while this script is running. Please install
+ a more recent version first.</tt>
+ </blockquote>
+
+ In that case, you'll need to update your setuptools install first,
+ either by running:
+
+ <pre>easy_install -U setuptools</pre>
- %(tools)s
+ or:
- <p><b>FIXME:</b> use pudge to generate rst docs for all tools funcs</p>
+ <pre>python ez_setup.py</pre>
+ </p>
+
+ %(body)s
<h2><a name="commands"></a>nosetests setuptools command</h2>
@@ -221,15 +244,15 @@
<h2>Bug reports</h2>
<p>Please report bugs and make feature
- requests <a href="http://nose.python-hosting.com">here</a>.</p>
+ requests <a href="http://code.google.com/p/python-nose/">here</a>.</p>
<h2>Hack</h2>
- <p><a href="http://nose.python-hosting.com/wiki/WritingPlugins">Write
+ <p><a href="http://code.google.com/p/python-nose/wiki/WritingPlugins">Write
plugins!</a> It's easy and fun.</p>
<p>Get the code:
- <pre>svn co http://svn.nose.python-hosting.com/trunk</pre>
+ <pre>svn checkout http://python-nose.googlecode.com/svn/trunk/ nose</pre>
</p>
<p><a href="mailto:jpellerin+nose@gmail.com">Patches are
@@ -239,8 +262,7 @@
tree easily.
</p>
- <p>Thanks to the great folks at python hosting for providing the
- subversion repository and trac instance.</p>
+ <p>Thanks to Google for providing the Google code hosting service.</p>
<h2><a name="changelog"></a>Changelog</h2>
%(changelog)s
diff --git a/nose/__init__.py b/nose/__init__.py
index 352c30d..b36e1ca 100644
--- a/nose/__init__.py
+++ b/nose/__init__.py
@@ -11,7 +11,17 @@ Use the nosetests script (after installation by setuptools)::
nosetests [options] [(optional) test files or directories]
-You may also use nose in a test script::
+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, with the -- prefix removed::
+
+ [nosetests]
+ verbosity=3
+ with-doctest
+
+There are several other ways to use the nose test runner besides the
+`nosetests` script. You may use nose in a test script::
import nose
nose.main()
@@ -27,19 +37,48 @@ or raised an uncaught exception. Lastly, you can run nose.core directly, which
will run nose.main()::
python /path/to/nose/core.py
-
+
Please see the usage message for the nosetests script for information
about how to control which tests nose runs, which plugins are loaded,
and the test output.
-
+
Features
--------
-Run as collect
-==============
+Writing tests is easier
+=======================
+
+nose collects tests from `unittest.TestCase` subclasses, of course. But you can
+also write simple test functions, and test classes that are not subclasses of
+`unittest.TestCase`. nose also supplies a number of helpful functions for
+writing timed tests, testing for exceptions, and other common use cases. See
+`Writing tests`_ and `Testing tools`_ for more.
-nose begins running tests as soon as the first test module is loaded, it
-does not wait to collect all tests before running the first.
+Running tests is easier
+=======================
+
+nose collects tests automatically, as long as you follow some simple
+guidelines for organizing your library and test code. There's no need to
+manually collect test cases into test suites. Running tests is also more
+responsive, since nose begins running tests as soon as the first test module
+is loaded. See `Finding and running tests`_ for more.
+
+Setting up your test environment is easier
+==========================================
+
+nose supports fixtures at the package, module, and test case level, so
+expensive initialization can be done as infrequently as possible. See
+Fixtures_ for more.
+
+Doing what you want to do is easier
+===================================
+
+nose has plugin hooks for loading, running, watching and reporting on tests
+and test runs. If you don't like the default collection scheme, or it doesn't
+suit the layout of your project, or you need reports in a format different
+from the unittest standard, or you need to collect some additional information
+about tests (like code coverage or profiling data), you can write a plugin to
+do so. See `Writing plugins`_ for more.
Output capture
==============
@@ -72,6 +111,9 @@ You will get output like::
assert a == 4, "assert 2 is 4"
AssertionError: assert 2 is 4
>> assert 2 == 4, "assert 2 is 4"
+
+Please note that dotted names are not expanded, and callables are not called
+in the expansion.
Setuptools integration
======================
@@ -102,19 +144,20 @@ using the setup.cfg file. See nose.commands_ for more information about the
.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
.. _nose.commands: #commands
+.. _Writing plugins: http://code.google.com/p/python-nose/wiki/WritingPlugins
Writing tests
-------------
-As with py.test, nose tests need not be subclasses of TestCase. Any function
-or class that matches the configured testMatch regular expression
-('(?:^|[\\b_\\.-])[Tt]est)'' by default) and lives in a module that also
-matches that expression will be run as a test. For the sake of compatibility
-with legacy unittest test cases, nose will also load tests from
-unittest.TestCase subclasses just like unittest does. Like py.test, functional
-tests will be run in the order in which they appear in the module
-file. TestCase derived tests and other test classes are run in alphabetical
-order.
+As with py.test, nose tests need not be subclasses of
+`unittest.TestCase`. Any function or class that matches the configured
+testMatch regular expression (`(?:^|[\\b_\\.-])[Tt]est)` by default)
+and lives in a module that also matches that expression will be run as
+a test. For the sake of compatibility with legacy unittest test cases,
+nose will also load tests from `unittest.TestCase` subclasses just like
+unittest does. Like py.test, functional tests will be run in the order
+in which they appear in the module file. TestCase derived tests and
+other test classes are run in alphabetical order.
Fixtures
========
@@ -135,9 +178,9 @@ and remove it in package teardown once per test run, rather than having to
create and tear it down once per test module or test case.
To create package-level setup and teardown methods, define setup and/or
-teardown functions in the __init__.py of a test package. Setup methods may
-be named 'setup', 'setup_package', 'setUp',or 'setUpPackage'; teardown may
-be named 'teardown', 'teardown_package', 'tearDown' or 'tearDownPackage'.
+teardown functions in the `__init__.py` of a test package. Setup methods may
+be named `setup`, `setup_package`, `setUp`, or `setUpPackage`; teardown may
+be named `teardown`, `teardown_package`, `tearDown` or `tearDownPackage`.
Execution of tests in a test package begins as soon as the first test
module is loaded from the test package.
@@ -146,26 +189,26 @@ Test modules
A test module is a python module that matches the testMatch regular
expression. Test modules offer module-level setup and teardown; define the
-method 'setup', 'setup_module', 'setUp' or 'setUpModule' for setup,
-'teardown', 'teardown_module', or 'tearDownModule' for teardown. Execution
+method `setup`, `setup_module`, `setUp` or `setUpModule` for setup,
+`teardown`, `teardown_module`, or `tearDownModule` for teardown. Execution
of tests in a test module begins after all tests are collected.
Test classes
============
A test class is a class defined in a test module that is either a subclass
-of unittest.TestCase, or matches testMatch. Test classes that don't
-descend from unittest.TestCase are run in the same way as those that do:
+of `unittest.TestCase`, or matches testMatch. Test classes that don't
+descend from `unittest.TestCase` are run in the same way as those that do:
methods in the class that match testMatch are discovered, and a test case
constructed to run each with a fresh instance of the test class. Like
-unittest.TestCase subclasses, other test classes may define setUp and
+`unittest.TestCase` subclasses, other test classes may define setUp and
tearDown methods that will be run before and after each test method.
Test functions
==============
Any function in a test module that matches testMatch will be wrapped in a
-FunctionTestCase and run as a test. The simplest possible failing test is
+`FunctionTestCase` and run as a test. The simplest possible failing test is
therefore::
def test():
@@ -187,7 +230,7 @@ the same setup, is to use the provided with_setup decorator::
def teardown_func():
# ...
- @with_setup(setup_func,teardown_func)
+ @with_setup(setup_func, teardown_func)
def test():
# ...
@@ -196,13 +239,17 @@ so::
def test():
# ...
- test = with_setup(setup_func,teardown_func)(test)
+ test = with_setup(setup_func, teardown_func)(test)
or by direct assignment::
test.setup = setup_func
test.teardown = teardown_func
+Please note that `with_setup` is useful *only* for test functions, not for
+test methods in TestCase subclasses or other test classes. For those cases,
+define `setUp` and `tearDown` methods in the class.
+
Test generators
===============
@@ -235,9 +282,49 @@ generator returns.
For generator methods, the setUp and tearDown methods of the class (if any)
will be run before and after each generated test case.
-Please note that method generators `are not` supported in unittest.TestCase
+Please note that method generators *are not* supported in `unittest.TestCase`
subclasses.
-
+
+Finding and running tests
+-------------------------
+
+nose, by default, follows a few simple rules for test discovery.
+
+* If it looks like a test, it's a test. Names of directories, modules,
+ classes and functions are compared against the testMatch regular
+ expression, and those that match are considered tests. Any class that is a
+ `unittest.TestCase` subclass is also collected, so long as it is inside of a
+ module that looks like a test.
+
+* Directories that don't look like tests and aren't packages are not
+ inspected.
+
+* Packages are always inspected, but they are only collected if they look
+ like tests. This means that you can include your tests inside of your
+ packages (somepackage/tests) and nose will collect the tests without
+ running package code inappropriately.
+
+* When a project appears to have library and test code organized into
+ separate directories, library directories are examined first.
+
+* When nose imports a module, it adds that module's directory to sys.path;
+ when the module is inside of a package, like package.module, it will be
+ loaded as package.module and the directory of *package* will be added to
+ sys.path.
+
+Be aware that plugins and command line options can change any of those rules.
+
+Testing tools
+-------------
+
+The nose.tools module provides a number of testing aids that you may
+find useful, including decorators for restricting test execution time
+and testing for exceptions, and all of the same assertX methods found
+in `unittest.TestCase` (only spelled in pep08 fashion, so assert_equal
+rather than assertEqual). See `nose.tools`_ for a complete list.
+
+.. _nose.tools: http://code.google.com/p/python-nose/wiki/TestingTools
+
About the name
--------------
@@ -250,10 +337,11 @@ About the name
Contact the author
------------------
-To report bugs, ask questions, or request features, please use the trac
-instance provided by the great folks at python hosting, here:
-http://nose.python-hosting.com. Or, email the author at
-jpellerin+nose at gmail dot com. Patches are welcome!
+You can email me at jpellerin+nose at gmail dot com.
+
+To report bugs, ask questions, or request features, please use the *issues*
+tab at the Google code site: http://code.google.com/p/python-nose/issues/list.
+Patches are welcome!
Similar test runners
--------------------
@@ -270,7 +358,7 @@ arguments for the respective tools.
License and copyright
---------------------
-nose is copyright Jason Pellerin 2005-2006
+nose is copyright Jason Pellerin 2005-2007
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
diff --git a/nose/commands.py b/nose/commands.py
index 23831f6..91a9284 100644
--- a/nose/commands.py
+++ b/nose/commands.py
@@ -102,4 +102,3 @@ class nosetests(Command):
self.__config.cfgToArg(option_name, value,
lambda o: o.replace('_', '-')))
TestProgram(argv=argv, config=self.__config)
-
diff --git a/nose/core.py b/nose/core.py
index 7799a3a..b0fb775 100644
--- a/nose/core.py
+++ b/nose/core.py
@@ -1,5 +1,7 @@
"""Implements nose test program and collector.
"""
+from __future__ import generators
+
import logging
import os
import re
@@ -7,6 +9,8 @@ import sys
import types
import unittest
from warnings import warn
+from warnings import warn
+import ConfigParser
from nose.config import Config, all_config_files
from nose.importer import add_path
@@ -17,7 +21,7 @@ from nose.util import absdir, isclass, tolist
log = logging.getLogger('nose.core')
-
+compat_24 = sys.version_info >= (2, 4)
class TestCollector:
"""Main nose test collector.
@@ -107,7 +111,7 @@ class TextTestRunner(unittest.TextTestRunner):
class TestProgram(unittest.TestProgram):
- """usage: %prog [options] [names]
+ r"""usage: %prog [options] [names]
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
@@ -117,7 +121,7 @@ class TestProgram(unittest.TestProgram):
directories and packages found in its working directory (which
defaults to the current working directory). Any python source file,
directory or package that matches the testMatch regular expression
- (by default: (?:^|[\\b_\\.-])[Tt]est) will be collected as a test (or
+ (by default: (?:^|[\b_\.-])[Tt]est) will be collected as a test (or
source for collection of tests). In addition, all other packages
found in the working directory are examined for python source files
or directories that match testMatch. Package discovery descends all
@@ -174,6 +178,21 @@ class TestProgram(unittest.TestProgram):
the additional features (error classes, and plugin-supplied
features such as output capture and assert introspection) detailed
in the options below.
+
+ 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, with the -- prefix removed:
+
+ [nosetests]
+ verbosity=3
+ with-doctest
+
+ All configuration files that are found will be loaded and their options
+ combined.
"""
verbosity = 1
diff --git a/nose/importer.py b/nose/importer.py
index 01735dd..d247230 100644
--- a/nose/importer.py
+++ b/nose/importer.py
@@ -4,6 +4,8 @@ necessary because test modules in different directories frequently have the
same names, which means that the first loaded would mask the rest when using
the builtin importer.
"""
+from __future__ import generators
+
import logging
import os
import sys
diff --git a/nose/loader.py b/nose/loader.py
index d9bcd44..3b19118 100644
--- a/nose/loader.py
+++ b/nose/loader.py
@@ -1,3 +1,5 @@
+from __future__ import generators
+
import logging
import os
import sys
diff --git a/nose/plugins/__init__.py b/nose/plugins/__init__.py
index 713fac6..9300b31 100644
--- a/nose/plugins/__init__.py
+++ b/nose/plugins/__init__.py
@@ -1,17 +1,17 @@
-"""nose plugins
-
-nose supports setuptools entry point plugins for test collection,
-selection, observation and reporting.
-
-Writing Plugins
+"""Writing Plugins
---------------
-Plugin classes should subclass nose.plugins.Plugin.
+nose supports setuptools_ entry point plugins for test collection,
+selection, observation and reporting. There are two basic rules for plugins:
-Plugins may implement any of the methods described in the class
-PluginInterface in nose.plugins.base. Please note that this class is for
-documentary purposes only; plugins may not subclass PluginInterface.
+ * Plugin classes should subclass `nose.plugins.Plugin`_.
+ * Plugins may implement any of the methods described in the class
+ PluginInterface in nose.plugins.base. Please note that this class is for
+ documentary purposes only; plugins may not subclass PluginInterface.
+.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
+.. _nose.plugins.Plugin: http://python-nose.googlecode.com/svn/trunk/nose/plugins/base.py
+
Registering
===========
@@ -35,20 +35,20 @@ to load the plugin.
Defining options
================
-All plugins must implement the methods `add_options(self, parser, env)`
-and `configure(self, options, conf)`. Subclasses of nose.plugins.Plugin
+All plugins must implement the methods ``add_options(self, parser, env)``
+and ``configure(self, options, conf)``. Subclasses of nose.plugins.Plugin
that want the standard options should call the superclass methods.
nose uses optparse.OptionParser from the standard library to parse
-arguments. A plugin's add_options() method receives a parser
+arguments. A plugin's ``add_options()`` method receives a parser
instance. It's good form for a plugin to use that instance only to add
additional arguments that take only long arguments (--like-this). Most
of nose's built-in arguments get their default value from an environment
variable. This is a good practice because it allows options to be
utilized when run through some other means than the nosetests script.
-A plugin's configure() receives the parsed OptionParser options object,
-as well as the current config object. Plugins should configure their
+A plugin's ``configure()`` method receives the parsed ``OptionParser`` options
+object, as well as the current config object. Plugins should configure their
behavior based on the user-selected settings, and may raise exceptions
if the configured behavior is nonsensical.
@@ -56,55 +56,63 @@ Logging
=======
nose uses the logging classes from the standard library. To enable users
-to view debug messages easily, plugins should use logging.getLogger() to
-acquire a logger in the 'nose.plugins' namespace.
+to view debug messages easily, plugins should use ``logging.getLogger()`` to
+acquire a logger in the ``nose.plugins`` namespace.
Recipes
=======
* Writing a plugin that monitors or controls test result output
- Implement any or all of addError, addFailure, etc., to monitor test
+ Implement any or all of ``addError``, ``addFailure``, etc., to monitor test
results. If you also want to monitor output, implement
- setOutputStream and keep a reference to the output stream. If you
- want to prevent the builtin TextTestResult output, implement
- setOutputSteam and return a dummy stream and send your desired output
- to the real stream.
+ ``setOutputStream`` and keep a reference to the output stream. If you
+ want to prevent the builtin ``TextTestResult`` output, implement
+ ``setOutputSteam`` and *return a dummy stream*. The default output will go
+ to the dummy stream, while you send your desired output to the real stream.
- Example: examples/html_plugin/htmlplug.py
+ Example: `examples/html_plugin/htmlplug.py`_
* Writing a plugin that loads tests from files other than python modules
- Implement wantFile and loadTestsFromPath. In wantFile, return True
- for files that you want to examine for tests. In loadTestsFromPath,
+ Implement ``wantFile`` and ``loadTestsFromFile``. In ``wantFile``, return
+ True for files that you want to examine for tests. In ``loadTestsFromFile``,
for those files, return a TestSuite or other iterable containing
- TestCases. loadTestsFromPath may also be a generator.
+ TestCases. ``loadTestsFromFile`` may also be a generator.
- Example: nose.plugins.doctests
+ Example: `nose.plugins.doctests`_
* Writing a plugin that prints a report
Implement begin if you need to perform setup before testing
- begins. Implement report and output your report to the provided stream.
+ begins. Implement ``report`` and output your report to the provided stream.
- Examples: nose.plugins.cover, nose.plugins.profile, nose.plugins.missed
+ Examples: `nose.plugins.cover`_, `nose.plugins.profile`_
* Writing a plugin that selects or rejects tests
- Implement any or all want* methods. Return False to reject the test
+ Implement any or all ``want*`` methods. Return False to reject the test
candidate, True to accept it -- which means that the test candidate
will pass through the rest of the system, so you must be prepared to
load tests from it if tests can't be loaded by the core loader or
another plugin -- and None if you don't care.
- Examples: nose.plugins.attrib, nose.plugins.doctests
-
+ Examples: `nose.plugins.attrib`_, `nose.plugins.doctests`_
+
Examples
========
-See nose.plugins.attrib, nose.plugins.cover, nose.plugins.doctests and
-nose.plugins.profile for examples. Further examples may be found the
-examples directory in the nose source distribution.
+See `nose.plugins.attrib`_, `nose.plugins.cover`_, `nose.plugins.doctests`_
+and `nose.plugins.profile`_ for examples. Further examples may be found the
+examples_ directory in the nose source distribution.
+
+.. _examples/html_plugin/htmlplug.py: http://python-nose.googlecode.com/svn/trunk/examples/html_plugin/htmlplug.py
+.. _examples: http://python-nose.googlecode.com/svn/trunk/examples
+.. _nose.plugins.attrib: http://python-nose.googlecode.com/svn/trunk/nose/plugins/attrib.py
+.. _nose.plugins.cover: http://python-nose.googlecode.com/svn/trunk/nose/plugins/cover.py
+.. _nose.plugins.doctests: http://python-nose.googlecode.com/svn/trunk/nose/plugins/doctests.py
+.. _nose.plugins.profile: http://python-nose.googlecode.com/svn/trunk/nose/plugins/profile.py
+
Testing Plugins
===============
@@ -153,5 +161,3 @@ from nose.plugins.base import Plugin
from nose.plugins.manager import *
from nose.plugins.plugintest import PluginTester
-
-
diff --git a/nose/plugins/attrib.py b/nose/plugins/attrib.py
index 78a08c6..6eb9dd1 100644
--- a/nose/plugins/attrib.py
+++ b/nose/plugins/attrib.py
@@ -26,6 +26,7 @@ Eval expression syntax (-A, --eval-attr) examples:
* nosetests -A "(priority > 5) and not slow"
"""
+import logging
import os
import re
import sys
@@ -34,6 +35,7 @@ from inspect import isfunction
from nose.plugins.base import Plugin
from nose.util import tolist
+log = logging.getLogger('nose.plugins.attrib')
compat_24 = sys.version_info >= (2, 4)
class ContextHelper:
@@ -44,6 +46,29 @@ class ContextHelper:
def __getitem__(self, name):
return self.obj.get(name, False)
+
+class AttributeGetter:
+ """Helper for looking up attributes
+
+ First we check the method, and if the attribute is not present,
+ we check the method's class.
+ """
+ missing = object()
+
+ def __init__(self, cls, method):
+ self.cls = cls
+ self.method = method
+
+ def get(self, name, default=None):
+ log.debug('Get %s from %s.%s', name, self.cls, self.method)
+ val = self.method.__dict__.get(name, self.missing)
+ if val is self.missing:
+ log.debug('No attribute %s in method, getting from class',
+ name)
+ val = getattr(self.cls, name, default)
+ log.debug('Class attribute %s value: %s', name, val)
+ return val
+
class AttributeSelector(Plugin):
"""Selects test cases to be run based on their attributes.
"""
@@ -182,9 +207,5 @@ class AttributeSelector(Plugin):
return self.validateAttrib(function.__dict__)
def wantMethod(self, method):
- # start with class attributes...
- cls = method.im_class
- attribs = cls.__dict__.copy()
- # method attributes override class attributes
- attribs.update(method.__dict__)
+ attribs = AttributeGetter(method.im_class, method)
return self.validateAttrib(attribs)
diff --git a/nose/plugins/base.py b/nose/plugins/base.py
index 9d02f84..79208e4 100644
--- a/nose/plugins/base.py
+++ b/nose/plugins/base.py
@@ -109,16 +109,16 @@ class IPluginInterface(object):
`enabled` and `name`.
Plugins may implement any or all of the methods documented
- below. Please note that they `must not` subclass PluginInterface;
+ below. Please note that they *must not* subclass PluginInterface;
PluginInterface is a only description of the plugin API.
When plugins are called, the first plugin that implements a method
and returns a non-None value wins, and plugin processing ends. The
- only exceptions to are `loadTestsFromModule`, `loadTestsFromName`,
+ exceptions to this are `loadTestsFromModule`, `loadTestsFromName`,
and `loadTestsFromPath`, which allow multiple plugins to load and
return tests.
- In general, plugin methods correspond directly to the methods of
+ In general, plugin methods correspond directly to methods of
nose.selector.Selector, nose.loader.TestLoader and
nose.result.TextTestResult are called by those methods when they are
called. In some cases, the plugin hook doesn't neatly match the
@@ -131,19 +131,21 @@ class IPluginInterface(object):
Selecting and loading tests
===========================
- To alter test selection behavior, implement any necessary want*
+ To alter test selection behavior, implement any necessary `want*`
methods as outlined below. Keep in mind, though, that when your
- plugin returns True from a want* method, you will send the requested
+ plugin returns True from a `want*` method, you will send the requested
object through the normal test collection process. If the object
represents something from which normal tests can't be collected, you
must also implement a loader method to load the tests.
Examples:
+
* The builtin doctests plugin, for python 2.4 only, implements
`wantFile` to enable loading of doctests from files that are not
python modules. It also implements `loadTestsFromModule` to load
doctests from python modules, and `loadTestsFromPath` to load tests
from the non-module files selected by `wantFile`.
+
* The builtin attrib plugin implements `wantFunction` and
`wantMethod` so that it can reject tests that don't match the
specified attributes.
@@ -157,9 +159,11 @@ class IPluginInterface(object):
correspond to TextTestResult methods.
Examples:
+
* The builtin cover plugin implements `begin` and `report` to
capture and report code coverage metrics for all or selected modules
loaded during testing.
+
* The builtin profile plugin implements `begin`, `prepareTest` and
`report` to record and output profiling information. In this
case, the plugin's `prepareTest` method constructs a function that
@@ -632,7 +636,7 @@ class IPluginInterface(object):
def setOutputStream(self, stream):
"""Called before test output begins. To direct test output to a
new stream, return a stream object, which must implement a
- write(msg) method. If you only want to note the stream, not
+ `write(msg)` method. If you only want to note the stream, not
capture or redirect it, then return None.
Parameters:
diff --git a/nose/plugins/cover.py b/nose/plugins/cover.py
index 6504d00..e5c514b 100644
--- a/nose/plugins/cover.py
+++ b/nose/plugins/cover.py
@@ -85,6 +85,7 @@ class Coverage(Plugin):
if self.coverErase:
log.debug("Clearing previously collected coverage statistics")
coverage.erase()
+ coverage.exclude('#pragma[: ]+[nN][oO] [cC][oO][vV][eE][rR]')
coverage.start()
def report(self, stream):
diff --git a/nose/plugins/doctests.py b/nose/plugins/doctests.py
index 55ca1a4..7ca780d 100644
--- a/nose/plugins/doctests.py
+++ b/nose/plugins/doctests.py
@@ -14,6 +14,8 @@ course of running a test.
.. _doctest: http://docs.python.org/lib/module-doctest.html
"""
+from __future__ import generators
+
import doctest
import logging
import os
@@ -24,6 +26,35 @@ from nose.util import anyp, getpackage, test_address, resolve_name, tolist
log = logging.getLogger(__name__)
+#
+# Doctest and coverage don't get along, so we need to create
+# a monkeypatch that will replace the part of doctest that
+# interferes with coverage reports.
+#
+# The monkeypatch is based on this zope patch:
+# http://svn.zope.org/Zope3/trunk/src/zope/testing/doctest.py?rev=28679&r1=28703&r2=28705
+#
+try:
+ _orp = doctest._OutputRedirectingPdb
+
+ class NoseOutputRedirectingPdb(_orp):
+ def __init__(self, out):
+ self.__debugger_used = False
+ _orp.__init__(self, out)
+
+ def set_trace(self):
+ self.__debugger_used = True
+ _orp.set_trace(self)
+
+ def set_continue(self):
+ # Calling set_continue unconditionally would break unit test
+ # coverage reporting, as Bdb.set_continue calls sys.settrace(None).
+ if self.__debugger_used:
+ _orp.set_continue(self)
+ doctest._OutputRedirectingPdb = NoseOutputRedirectingPdb
+except AttributeError:
+ # Python 2.3: no support
+ pass
class Doctest(Plugin):
"""
@@ -132,8 +163,10 @@ class Doctest(Plugin):
# also want files that match my extension
if (self.extension
and anyp(file.endswith, self.extension)
- and (self.conf.exclude is None
- or not self.conf.exclude.search(file))):
+ and (not self.conf.exclude
+ or not filter(None,
+ [exc.search(file)
+ for exc in self.conf.exclude]))):
return True
return None
@@ -157,7 +190,7 @@ class DocTestCase(doctest.DocTestCase):
return test_address(self._nose_obj)
return test_address(resolve_name(self._dt_test.name))
- # Annoyingly, doctests loaded via find(obj) omit the module name
+ # doctests loaded via find(obj) omit the module name
# so we need to override id, __repr__ and shortDescription
# bonus: this will squash a 2.3 vs 2.4 incompatiblity
def id(self):
diff --git a/nose/plugins/prof.py b/nose/plugins/prof.py
index a489182..df9795e 100644
--- a/nose/plugins/prof.py
+++ b/nose/plugins/prof.py
@@ -21,6 +21,8 @@ class Profile(Plugin):
"""
Use this plugin to run tests using the hotshot profiler.
"""
+ pfile = None
+ clean_stats_file = False
def options(self, parser, env=os.environ):
Plugin.options(self, parser, env)
parser.add_option('--profile-sort',action='store',dest='profile_sort',
@@ -38,6 +40,7 @@ class Profile(Plugin):
"pstats.Stats for details")
def begin(self):
+ self._create_pfile()
self.prof = hotshot.Profile(self.pfile)
def configure(self, options, conf):
@@ -47,18 +50,18 @@ class Profile(Plugin):
if options.profile_stats_file:
self.pfile = options.profile_stats_file
+ self.clean_stats_file = False
else:
- fileno, filename = tempfile.mkstemp()
- # close the open handle immediately, hotshot needs to open
- # the file itself
- os.close(fileno)
- self.pfile = filename
+ self.pfile = None
+ self.clean_stats_file = True
+ self.fileno = None
self.sort = options.profile_sort
self.restrict = tolist(options.profile_restrict)
def prepareTest(self, test):
log.debug('preparing test %s' % test)
def run_and_profile(result, prof=self.prof, test=test):
+ self._create_pfile()
prof.runcall(test, result)
return run_and_profile
@@ -77,3 +80,20 @@ class Profile(Plugin):
stats.print_stats()
finally:
sys.stdout = tmp
+
+ def finalize(self, result):
+ if self.clean_stats_file:
+ if self.fileno:
+ try:
+ os.close(self.fileno)
+ except OSError:
+ pass
+ try:
+ os.unlink(self.pfile)
+ except OSError:
+ pass
+ return None
+
+ def _create_pfile(self):
+ if not self.pfile:
+ self.fileno, self.pfile = tempfile.mkstemp()
diff --git a/nose/proxy.py b/nose/proxy.py
index ade3cfe..5b53666 100644
--- a/nose/proxy.py
+++ b/nose/proxy.py
@@ -161,91 +161,3 @@ class ResultProxy(object):
shouldStop = property(get_shouldStop, set_shouldStop, None,
"""Should the test run stop?""")
-
-# old
-
-# class ResultProxy(Result):
-# """Result proxy. Performs nose-specific result operations, such as
-# handling output capture, inspecting assertions and calling plugins,
-# then delegates to another result handler.
-# """
-# def __init__(self, result):
-# self.result = result
-
-# def addError(self, test, err):
-# log.debug('Proxy addError %s %s', test, err)
-# Result.addError(self, test, err)
-
-# # compose a new error object that includes captured output
-# if self.capt is not None and len(self.capt):
-# ec, ev, tb = err
-# ev = '\n'.join([str(ev) , ln('>> begin captured stdout <<'),
-# self.capt, ln('>> end captured stdout <<')])
-# err = (ec, ev, tb)
-# self.result.addError(test, err)
-
-# def addFailure(self, test, err):
-# log.debug('Proxy addFailure %s %s', test, err)
-# Result.addFailure(self, test, err)
-
-# # compose a new error object that includes captured output
-# # and assert introspection data
-# ec, ev, tb = err
-# if self.tbinfo is not None and len(self.tbinfo):
-# ev = '\n'.join([str(ev), self.tbinfo])
-# if self.capt is not None and len(self.capt):
-# ev = '\n'.join([str(ev) , ln('>> begin captured stdout <<'),
-# self.capt, ln('>> end captured stdout <<')])
-# err = (ec, ev, tb)
-# self.result.addFailure(test, err)
-
-# def addSuccess(self, test):
-# Result.addSuccess(self, test)
-# self.result.addSuccess(test)
-
-# def startTest(self, test):
-# Result.startTest(self, test)
-# self.result.startTest(test)
-
-# def stopTest(self, test):
-# Result.stopTest(self, test)
-# self.result.stopTest(test)
-
-# def _get_shouldStop(self):
-# return self.result.shouldStop
-
-# def _set_shouldStop(self, val):
-# self.result.shouldStop = val
-
-# shouldStop = property(_get_shouldStop, _set_shouldStop)
-
-
-# class TestProxy(unittest.TestCase):
-# """Test case that wraps the test result in a ResultProxy.
-# """
-# resultProxy = ResultProxy
-
-# def __init__(self, wrapped_test):
-# self.wrapped_test = wrapped_test
-# log.debug('%r.__init__', self)
-
-# def __call__(self, *arg, **kw):
-# log.debug('%r.__call__', self)
-# self.run(*arg, **kw)
-
-# def __repr__(self):
-# return "TestProxy for: %r" % self.wrapped_test
-
-# def __str__(self):
-# return str(self.wrapped_test)
-
-# def id(self):
-# return self.wrapped_test.id()
-
-# def run(self, result):
-# log.debug('TestProxy run test %s in proxy %s for result %s',
-# self, self.resultProxy, result)
-# self.wrapped_test(self.resultProxy(result))
-
-# def shortDescription(self):
-# return self.wrapped_test.shortDescription()
diff --git a/nose/selector.py b/nose/selector.py
index 2eeeb9e..2a670af 100644
--- a/nose/selector.py
+++ b/nose/selector.py
@@ -120,7 +120,10 @@ class Selector(object):
"""Is the function a test function?
"""
try:
- funcname = function.__name__
+ if hasattr(function, 'compat_func_name'):
+ funcname = function.compat_func_name
+ else:
+ funcname = function.__name__
except AttributeError:
# not a function
return False
diff --git a/nose/suite.py b/nose/suite.py
index 44e3f14..afb10b1 100644
--- a/nose/suite.py
+++ b/nose/suite.py
@@ -1,3 +1,5 @@
+from __future__ import generators
+
import logging
import sys
import unittest
@@ -251,7 +253,7 @@ class ContextSuite(LazySuite):
try_run(context, names)
# FIXME plugins.contextTeardown(context)
- # FIXME the wrapping has to move to the factory
+ # FIXME the wrapping has to move to the factory?
def _get_wrapped_tests(self):
for test in self._get_tests():
if isinstance(test, Test) or isinstance(test, unittest.TestSuite):
@@ -293,7 +295,6 @@ class ContextSuiteFactory(object):
suite of suites returned, organized into a stack with the
outermost suites belonging to the outermost contexts.
"""
-
log.debug("Create suite for %s", tests)
context = getattr(tests, 'context', None)
if context is None:
@@ -401,7 +402,6 @@ class ContextSuiteFactory(object):
common.append(test)
found_common = True
break
- # no common ancestor found
if not found_common:
remain.append(test)
if common:
@@ -442,4 +442,4 @@ class TestModule:
raise NotImplementedError(
"TestModule is not usable with nose 0.10. The class is present "
"in nose.suite for backwards compatibility purposes but it "
- "may not be used")
+ "may not be used.")
diff --git a/nose/tools.py b/nose/tools.py
index d60d844..12bcb08 100644
--- a/nose/tools.py
+++ b/nose/tools.py
@@ -8,6 +8,8 @@ on any of these methods.
"""
import time
+__all__ = ['ok_', 'eq_', 'make_decorator', 'raises', 'timed', 'with_setup',
+ 'TimeExpired']
class TimeExpired(AssertionError):
pass
@@ -29,11 +31,16 @@ def make_decorator(func):
(namely, setup and teardown).
"""
def decorate(newfunc):
- name = func.__name__
+ if hasattr(func, 'compat_func_name'):
+ name = func.compat_func_name
+ else:
+ name = func.__name__
+ newfunc.__dict__ = func.__dict__
+ newfunc.__doc__ = func.__doc__
+ newfunc.__module__ = func.__module__
+ if not hasattr(newfunc, 'compat_co_firstlineno'):
+ newfunc.compat_co_firstlineno = func.func_code.co_firstlineno
try:
- newfunc.__doc__ = func.__doc__
- newfunc.__module__ = func.__module__
- newfunc.__dict__ = func.__dict__
newfunc.__name__ = name
except TypeError:
# can't set func name in 2.3
@@ -88,11 +95,14 @@ def timed(limit):
return decorate
def with_setup(setup=None, teardown=None):
- """Decorator to add setup and/or teardown methods to a test function
+ """Decorator to add setup and/or teardown methods to a test function::
+
+ @with_setup(setup, teardown)
+ def test_something():
+ # ...
- @with_setup(setup, teardown)
- def test_something():
- # ...
+ Note that `with_setup` is useful *only* for test functions, not for test
+ methods or inside of TestCase subclasses.
"""
def decorate(func, setup=setup, teardown=teardown):
if setup:
diff --git a/nosetests.1 b/nosetests.1
new file mode 100644
index 0000000..f252a4b
--- /dev/null
+++ b/nosetests.1
@@ -0,0 +1,247 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
+.TH NOSETESTS "1" "January 2007" "nosetests version 0.9.2" "User Commands"
+.SH NAME
+nosetests \- unit testing for Python software
+.SH SYNOPSIS
+\fBnosetests\fP [\fIoptions\fP] [\fInames\fP]
+.SH DESCRIPTION
+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 magic.
+
+nose collects tests automatically from python source files,
+directories and packages found in its working directory (which
+defaults to the current working directory). Any python source file,
+directory or package that matches the testMatch regular expression
+(by default: (?:^|[\eb_\e.\-])[Tt]est) will be collected as a test (or
+source for collection of tests). In addition, all other packages
+found in the working directory are examined for python source files
+or directories that match testMatch. Package discovery descends all
+the way down the tree, so package.tests and package.sub.tests and
+package.sub.sub2.tests will all be collected.
+
+Within a test directory or package, any python source file matching
+testMatch will be examined for test cases. Within a test file,
+functions and classes whose names match testMatch and TestCase
+subclasses with any name will be loaded and executed as tests. Tests
+may use the assert keyword or raise AssertionErrors to indicate test
+failure. TestCase subclasses may do the same or use the various
+TestCase methods available.
+
+Tests may raise nose.SkipTest to indicate that they should be
+skipped or nose.DeprecatedTest to indicate that they are
+deprecated. Skipped and deprecated tests do not count as failures,
+but details on them are printed at the end of the test run along
+with any failures and errors.
+
+.B Selecting Tests
+
+To specify which tests to run, pass test names on the command line:
+
+nosetests only_test_this.py
+
+Test names specified may be file or module names, and may optionally
+indicate the test case to run by separating the module or file name
+from the test case name with a colon. Filenames may be relative or
+absolute. Examples:
+
+nosetests test.module
+
+nosetests another.test:TestCase.test_method
+
+nosetests a.test:TestCase
+
+nosetests /path/to/test/file.py:test_function
+
+Note however that specifying a test name will *not* cause nose to run
+a test that it does not discover. Test names specified are compared
+against tests discovered, and only the requested tests are
+run. Setup and teardown methods are run at all stages. That means
+that if you run:
+
+nosetests some.tests.test_module:test_function
+
+And have defined setup or teardown methods in tests and test_module,
+those setup methods will run before the test_function test, and
+teardown after, just as if you were running all tests.
+
+You may also change the working directory where nose looks for tests,
+use the \fB\-w\fR switch:
+
+nosetests \fB\-w\fR /path/to/tests
+
+Further customization of test selection and loading is possible
+through the use of plugins.
+
+Test result output is identical to that of unittest, except for the
+additional features (output capture, assert introspection, and any plugins
+that control or produce output) detailed in the options below.
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+show this help message and exit
+.TP
+\fB\-V\fR, \fB\-\-version\fR
+Output nose version and exit
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Be more verbose. [NOSE_VERBOSE]
+.TP
+\fB\-\-verbosity\fR=\fIVERBOSITY\fR
+Set verbosity; \fB\-\-verbosity\fR=\fI2\fR is the same as \fB\-vv\fR
+.TP
+\fB\-l\fR DEBUG, \fB\-\-debug\fR=\fIDEBUG\fR
+Activate debug logging for one or more systems.
+Available debug loggers: nose, nose.importer,
+nose.inspector, nose.plugins, nose.result and
+nose.selector. Separate multiple names with a comma.
+.TP
+\fB\-\-debug\-log\fR=\fIDEBUG_LOG\fR
+Log debug messages to this file (default: sys.stderr)
+.HP
+\fB\-q\fR, \fB\-\-quiet\fR
+.TP
+\fB\-w\fR WHERE, \fB\-\-where\fR=\fIWHERE\fR
+Look for tests in this directory [NOSE_WHERE]
+.TP
+\fB\-e\fR EXCLUDE, \fB\-\-exclude\fR=\fIEXCLUDE\fR
+Don't run tests that match regular expression
+[NOSE_EXCLUDE]
+.TP
+\fB\-i\fR INCLUDE, \fB\-\-include\fR=\fIINCLUDE\fR
+Also run tests that match regular expression
+[NOSE_INCLUDE]
+.TP
+\fB\-m\fR TEST_MATCH, \fB\-\-match\fR=\fITEST_MATCH\fR, \fB\-\-testmatch\fR=\fITEST_MATCH\fR
+Use this regular expression to find tests
+[NOSE_TESTMATCH]
+.TP
+\fB\-s\fR, \fB\-\-nocapture\fR
+Don't capture stdout (any stdout output will be
+printed immediately) [NOSE_NOCAPTURE]
+.TP
+\fB\-d\fR, \fB\-\-detailed\-errors\fR
+Add detail to error output by attempting to evaluate
+failed asserts [NOSE_DETAILED_ERRORS]
+.TP
+\fB\-\-pdb\fR
+Drop into debugger on errors
+.TP
+\fB\-\-pdb\-failures\fR
+Drop into debugger on failures
+.TP
+\fB\-x\fR, \fB\-\-stop\fR
+Stop running tests after the first error or failure
+.TP
+\fB\-P\fR, \fB\-\-no\-path\-adjustment\fR
+Don't make any changes to sys.path when loading tests
+[NOSE_NOPATH]
+.TP
+\fB\-\-exe\fR
+Look for tests in python modules that are executable.
+Normal behavior is to exclude executable modules,
+since they may not be import\-safe [NOSE_INCLUDE_EXE]
+.TP
+\fB\-\-noexe\fR
+DO NOT look for tests in python modules that are
+executable. (The default on the windows platform is to
+do so.)
+.TP
+\fB\-\-with\-profile\fR
+Enable plugin Profile: Use this plugin to run tests
+using the hotshot profiler. [NOSE_WITH_PROFILE]
+.TP
+\fB\-\-profile\-sort\fR=\fIPROFILE_SORT\fR
+Set sort order for profiler output
+.TP
+\fB\-\-profile\-stats\-file\fR=\fIPROFILE_STATS_FILE\fR
+Profiler stats file; default is a new temp file on
+each run
+.TP
+\fB\-\-profile\-restrict\fR=\fIPROFILE_RESTRICT\fR
+Restrict profiler output. See help for pstats.Stats
+for details
+.TP
+\fB\-\-with\-missed\-tests\fR
+Enable plugin MissedTests: Enable to get a warning
+when tests specified on the command line are not found
+during the test run. [NOSE_WITH_MISSED\-TESTS]
+.TP
+\fB\-\-with\-isolation\fR
+Enable plugin IsolationPlugin: Activate the isolation
+plugin to isolate changes to external modules to a
+single test module or package. The isolation plugin
+resets the contents of sys.modules after each test
+module or package runs to its state before the test.
+PLEASE NOTE that this plugin may not be used with the
+coverage plugin. [NOSE_WITH_ISOLATION]
+.TP
+\fB\-\-with\-doctest\fR
+Enable plugin Doctest: Activate doctest plugin to
+find and run doctests in non\-test modules.
+[NOSE_WITH_DOCTEST]
+.TP
+\fB\-\-doctest\-tests\fR
+Also look for doctests in test modules
+[NOSE_DOCTEST_TESTS]
+.TP
+\fB\-\-doctest\-extension\fR=\fIDOCTESTEXTENSION\fR
+Also look for doctests in files with this extension
+[NOSE_DOCTEST_EXTENSION]
+.TP
+\fB\-\-with\-coverage\fR
+Enable plugin Coverage: If you have Ned Batchelder's
+coverage module installed, you may activate a coverage
+report. The coverage report will cover any python
+source module imported after the start of the test
+run, excluding modules that match testMatch. If you
+want to include those modules too, use the \fB\-\-covertests\fR switch, or set the NOSE_COVER_TESTS environment
+variable to a true value. To restrict the coverage
+report to modules from a particular package or
+packages, use the \fB\-\-cover\-packages\fR switch or the
+NOSE_COVER_PACKAGES environment variable.
+[NOSE_WITH_COVERAGE]
+.TP
+\fB\-\-cover\-package\fR=\fICOVER_PACKAGES\fR
+Restrict coverage output to selected packages
+[NOSE_COVER_PACKAGE]
+.TP
+\fB\-\-cover\-erase\fR
+Erase previously collected coverage statistics before
+run
+.TP
+\fB\-\-cover\-tests\fR
+Include test modules in coverage report
+[NOSE_COVER_TESTS]
+.TP
+\fB\-\-cover\-inclusive\fR
+Include all python files under working directory in
+coverage report. Useful for discovering holes in test
+coverage if not all files are imported by the test
+suite. [NOSE_COVER_INCLUSIVE]
+.TP
+\fB\-a\fR ATTR, \fB\-\-attr\fR=\fIATTR\fR
+Run only tests that have attributes specified by ATTR
+[NOSE_ATTR]
+.TP
+\fB\-A\fR EXPR, \fB\-\-eval\-attr\fR=\fIEXPR\fR
+Run only tests for whose attributes the Python
+expression EXPR evaluates to True [NOSE_EVAL_ATTR]
+.SH AUTHOR
+.B nose
+is written by Jason Pellerin. This manpage was adapted from the output
+of the
+.B help2man(1)
+program by Jason Pellerin, following the version made by Gustavo Noronha Silva for the Debian GNU/Linux system, but
+may be used by others.
+.SH COPYRIGHT
+Copyright (C) 2005-2007 Jason Pellerin
+
+This is free software. You may redistribute copies of it under the
+terms of the GNU Lesser General Public License
+<http://www.gnu.org/licenses/lgpl.html>. There is NO WARRANTY, to the
+extent permitted by law.
+.SH SEE ALSO
+The project website is at
+.B http://somethingaboutorange.com/mrl/projects/nose/
+.
diff --git a/scripts/mkindex.py b/scripts/mkindex.py
index 9c55bcd..24bdba6 100755
--- a/scripts/mkindex.py
+++ b/scripts/mkindex.py
@@ -20,9 +20,9 @@ docs = publish_parts(txt, writer_name='html')
docs.update({'version': nose.__version__,
'date': time.ctime()})
-print "Tools..."
-tools = publish_parts(nose.tools.__doc__, writer_name='html')
-docs['tools'] = tools['body']
+#print "Tools..."
+#tools = publish_parts(nose.tools.__doc__, writer_name='html')
+#docs['tools'] = tools['body']
print "Commands..."
cmds = publish_parts(nose.commands.__doc__, writer_name='html')
diff --git a/scripts/mkrelease.py b/scripts/mkrelease.py
index be7f4af..eb1e14f 100755
--- a/scripts/mkrelease.py
+++ b/scripts/mkrelease.py
@@ -4,14 +4,17 @@
# create and upload a release
import os
import nose
+import sys
from commands import getstatusoutput
success = 0
current = os.getcwd()
-here = os.path.dirname(os.path.dirname(__file__))
-svnroot = os.path.abspath(os.path.join(here, '..', '..', 'nose_svn'))
+here = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+svnroot = os.path.abspath(os.path.dirname(here))
+branchroot = os.path.join(svnroot, 'branches')
+tagroot = os.path.join(svnroot, 'tags')
svntrunk = os.path.join(svnroot, 'trunk')
def runcmd(cmd):
@@ -31,6 +34,7 @@ print "cd %s" % svnroot
branch = 'branches/%s.%s.%s-stable' % (versioninfo[0],
versioninfo[1], versioninfo[2])
tag = 'tags/%s-release' % version
+
if os.path.isdir(tag):
raise Exception("Tag path %s already exists. Can't release same version "
"twice!")
@@ -69,11 +73,16 @@ print "cd %s" % tag
runcmd('svn rm setup.cfg --force') # remove dev tag from setup
# check in
-os.chdir(svnroot)
-print "cd %s" % svnroot
-runcmd("svn ci -m 'Release branch/tag for %s'" % version)
+os.chdir(branchroot)
+print "cd %s" % branchroot
+runcmd("svn ci -m 'Release branch for %s'" % version)
+
+os.chdir(tagroot)
+print "cd %s" % tagroot
+runcmd("svn ci -m 'Release tag for %s'" % version)
# make docs
+os.chdir(svnroot)
os.chdir(tag)
print "cd %s" % tag
diff --git a/scripts/mkwiki.py b/scripts/mkwiki.py
index 5716fe0..d2a214b 100755
--- a/scripts/mkwiki.py
+++ b/scripts/mkwiki.py
@@ -1,18 +1,163 @@
#!/usr/bin/env python
+from commands import getstatusoutput
from docutils.core import publish_string, publish_parts
-import base64
+from docutils.nodes import SparseNodeVisitor
+from docutils.readers.standalone import Reader
+from docutils.writers import Writer
+import nose
import os
import pudge.browser
import re
import sys
import textwrap
import time
-from twill.commands import *
-from twill import get_browser
-import nose
+# constants
+success = 0
div = '\n----\n'
+warning = """
+*Do not edit above this line. Content above this line is automatically
+generated and edits above this line will be discarded.*
+
+= Comments =
+"""
+
+def ucfirst(s):
+ return s[0].upper() + s[1:].lower()
+
+def words(s):
+ return s.split(' ')
+
+def wiki_word(node):
+ print "Unknown ref %s" % node.astext()
+ node['refuri'] = ''.join(map(ucfirst, words(node.astext())))
+ del node['refname']
+ node.resolved = True
+ return True
+wiki_word.priority = 100
+
+class WWReader(Reader):
+ unknown_reference_resolvers = (wiki_word,)
+
+
+class WikiWriter(Writer):
+ def translate(self):
+ visitor = WikiVisitor(self.document)
+ self.document.walkabout(visitor)
+ self.output = visitor.astext()
+
+
+class WikiVisitor(SparseNodeVisitor):
+ def __init__(self, document):
+ SparseNodeVisitor.__init__(self, document)
+ self.list_depth = 0
+ self.list_item_prefix = None
+ self.indent = self.old_indent = ''
+ self.output = []
+ self.preformat = False
+
+ def astext(self):
+ return ''.join(self.output)
+
+ def visit_Text(self, node):
+ #print "Text", node
+ data = node.astext()
+ if not self.preformat:
+ data = data.lstrip('\n\r')
+ data = data.replace('\r', '')
+ data = data.replace('\n', ' ')
+ self.output.append(data)
+
+ def visit_bullet_list(self, node):
+ self.list_depth += 1
+ self.list_item_prefix = (' ' * self.list_depth) + '* '
+
+ def depart_bullet_list(self, node):
+ self.list_depth -= 1
+ if self.list_depth == 0:
+ self.list_item_prefix = None
+ else:
+ (' ' * self.list_depth) + '* '
+ self.output.append('\n\n')
+
+ def visit_list_item(self, node):
+ self.old_indent = self.indent
+ self.indent = self.list_item_prefix
+
+ def depart_list_item(self, node):
+ self.indent = self.old_indent
+
+ def visit_literal_block(self, node):
+ self.output.extend(['{{{', '\n'])
+ self.preformat = True
+
+ def depart_literal_block(self, node):
+ self.output.extend(['\n', '}}}', '\n\n'])
+ self.preformat = False
+
+ def visit_paragraph(self, node):
+ self.output.append(self.indent)
+
+ def depart_paragraph(self, node):
+ self.output.append('\n\n')
+ if self.indent == self.list_item_prefix:
+ # we're in a sub paragraph of a list item
+ self.indent = ' ' * self.list_depth
+
+ def visit_reference(self, node):
+ if node.has_key('refuri'):
+ href = node['refuri']
+ elif node.has_key('refid'):
+ href = '#' + node['refid']
+ else:
+ href = None
+ self.output.append('[' + href + ' ')
+
+ def depart_reference(self, node):
+ self.output.append(']')
+
+ def visit_subtitle(self, node):
+ self.output.append('=== ')
+
+ def depart_subtitle(self, node):
+ self.output.append(' ===\n\n')
+ self.list_depth = 0
+ self.indent = ''
+
+ def visit_title(self, node):
+ self.output.append('== ')
+
+ def depart_title(self, node):
+ self.output.append(' ==\n\n')
+ self.list_depth = 0
+ self.indent = ''
+
+ def visit_title_reference(self, node):
+ self.output.append("`")
+
+ def depart_title_reference(self, node):
+ self.output.append("`")
+
+ def visit_emphasis(self, node):
+ self.output.append('*')
+
+ def depart_emphasis(self, node):
+ self.output.append('*')
+
+ def visit_literal(self, node):
+ self.output.append('`')
+
+ def depart_literal(self, node):
+ self.output.append('`')
+
+
+def runcmd(cmd):
+ print cmd
+ (status,output) = getstatusoutput(cmd)
+ if status != success:
+ raise Exception(output)
+
def section(doc, name):
m = re.search(r'(%s\n%s.*?)\n[^\n-]{3,}\n-{3,}\n' %
@@ -21,25 +166,10 @@ def section(doc, name):
return m.groups()[0]
raise Exception('Section %s not found' % name)
+
def wikirst(doc):
- #
- # module -> page links (will be subbed into each page's string)
- #
- modlinks = { r'\bnose\.plugins\b': 'WritingPlugins'
-
-
- }
-
- # not working at all..
- #for k in modlinks:
- # doc = re.sub(k, '`' + modlinks[k] + '`:trac', doc)
-
- doc = '`This page is autogenerated. Please add comments only ' \
- 'beneath the horizontal rule at the bottom of the page. ' \
- 'Changes above that line will be lost when the page is '\
- 'regenerated.`\n\n' + doc
-
- return '{{{\n#!rst\n%s\n}}}\n' % doc
+ return publish_string(doc, reader=WWReader(), writer=WikiWriter())
+
def plugin_interface():
"""use pudge browser to generate interface docs
@@ -49,16 +179,18 @@ def plugin_interface():
m = b.modules()[0]
intf = list([ c for c in m.classes() if c.name ==
'IPluginInterface'])[0]
- doc = '{{{\n#!rst\n' + intf.doc() + '\n}}}\n'
+ doc = wikirst(intf.doc())
methods = [ m for m in intf.routines() if not m.name.startswith('_') ]
methods.sort(lambda a, b: cmp(a.name, b.name))
- doc = doc + '{{{\n#!html\n'
+ mdoc = []
for m in methods:
- doc = doc + '<b>' + m.name + m.formatargs() + '</b><br />'
- doc = doc + m.doc(html=1)
- doc = doc + '\n}}}\n'
+ mdoc.append('*%s%s*\n\n' % (m.name, m.formatargs()))
+ mdoc.append(' ' + m.doc().replace('\n', '\n '))
+ mdoc.append('\n\n')
+ doc = doc + ''.join(mdoc)
return doc
+
def example_plugin():
# FIXME dump whole example plugin code from setup.py and plug.py
# into python source sections
@@ -68,10 +200,35 @@ def example_plugin():
setup = file(os.path.join(exp, 'setup.py'), 'r').read()
plug = file(os.path.join(exp, 'plug.py'), 'r').read()
- wik = "'''%s:'''\n{{{\n#!python\n%s\n}}}\n"
+ wik = "*%s:*\n{{{\n%s\n}}}\n"
return wik % ('setup.py', setup) + wik % ('plug.py', plug)
-def mkwiki(url, realm, user, passwd):
+
+def tools():
+ top = wikirst(nose.tools.__doc__)
+ b = pudge.browser.Browser(['nose.tools'], None)
+ m = b.modules()[0]
+ funcs = [ (f.name, f.formatargs().replace('(self, ', '('), f.doc())
+ for f in m.routines() ]
+ funcs.sort()
+ mdoc = [top, '\n\n']
+ for name, args, doc in funcs:
+ mdoc.append("*%s%s*\n\n" % (name, args))
+ mdoc.append(' ' + doc.replace('\n', '\n '))
+ mdoc.append('\n\n')
+ return ''.join(mdoc)
+
+
+def usage():
+ doc = nose.core.TestProgram.__doc__.replace("\\", "\\\\")
+ parser = nose.core.get_parser(env={}, builtin_only=True, doc=doc)
+ out = '{{{\n' + \
+ parser.format_help().replace('mkwiki.py', 'nosetests') + \
+ '\n}}}\n'
+ return out
+
+
+def mkwiki(path):
#
# Pages to publish and the docstring(s) to load for that page
#
@@ -81,66 +238,95 @@ def mkwiki(url, realm, user, passwd):
'NoseFeatures': wikirst(section(nose.__doc__, 'Features')),
'WritingPlugins': wikirst(nose.plugins.__doc__),
'PluginInterface': plugin_interface(),
+ 'TestingTools': tools(),
+ 'FindingAndRunningTests': wikirst(
+ section(nose.__doc__, 'Finding and running tests')),
# FIXME finish example plugin doc... add some explanation
'ExamplePlugin': example_plugin(),
- 'NosetestsUsage': '\n{{{\n' +
- nose.configure(help=True).replace('mkwiki.py', 'nosetests') +
- '\n}}}\n'
+ 'NosetestsUsage': usage(),
}
-
- w = TracWiki(url, realm, user, passwd)
+ current = os.getcwd()
+ w = Wiki(path)
for page, doc in pages.items():
print "====== %s ======" % page
w.update_docs(page, doc)
print "====== %s ======" % page
+ os.chdir(current)
+
-class TracWiki(object):
+class Wiki(object):
doc_re = re.compile(r'(.*?)' + div, re.DOTALL)
- def __init__(self, url, realm, user, passwd):
- self.url = url
- self.b = get_browser()
- go(url)
- add_auth(realm, url, user, passwd)
- go('/login')
+ def __init__(self, path):
+ self.path = path
+ self.newpages = []
+ os.chdir(path)
+ runcmd('svn up')
+
+ def filename(self, page):
+ if not page.endswith('.wiki'):
+ page = page + '.wiki'
+ return page
def get_page(self, page):
- go('/wiki/%s?edit=yes' % page)
- self.edit = self.b.get_form('edit')
- return self.edit.get_value('text')
+ headers = []
+ content = []
+
+ try:
+ fh = file(self.filename(page), 'r')
+ in_header = True
+ for line in fh:
+ if in_header:
+ if line.startswith('#'):
+ headers.append(line)
+ else:
+ in_header = False
+ content.append(line)
+ else:
+ content.append(line)
+ fh.close()
+ return (headers, ''.join(content))
+ except IOError:
+ self.newpages.append(page)
+ return ''
- def set_docs(self, page_src, docs):
+ def set_docs(self, page, headers, page_src, docs):
wikified = docs + div
- if self.doc_re.search(page_src):
- print "! Updating doc section"
- new_src = self.doc_re.sub(wikified, page_src, 1)
+ if not page_src:
+ new_src = wikified + warning
+ print "! Adding new page"
else:
- print "! Adding new doc section"
- new_src = wikified + page_src
+ m = self.doc_re.search(page_src)
+ if m:
+ print "! Updating doc section"
+ new_src = self.doc_re.sub(wikified, page_src, 1)
+ else:
+ print "! Adding new doc section"
+ new_src = wikified + page_src
if new_src == page_src:
print "! No changes"
- return
- fv(re.compile('edit'), 'text', new_src)
- submit('save')
-
+ return
+ # Restore any headers (lines marked by # at start of file)
+ if headers:
+ new_src = ''.join(headers) + '\n' + new_src
+ fh = file(self.filename(page), 'w')
+ fh.write(new_src)
+ fh.close()
+
def update_docs(self, page, doc):
- current = self.get_page(page)
- self.set_docs(current, doc)
+ headers, current = self.get_page(page)
+ self.set_docs(page, headers, current, doc)
+ if page in self.newpages:
+ runcmd('svn add %s' % self.filename(page))
def main():
+ path = os.path.abspath(
+ os.path.join(os.path.dirname(__file__), '..', '..', 'wiki'))
+ mkwiki(path)
- try:
- url = sys.argv[1]
- except IndexError:
- url = 'https://nose.python-hosting.com'
- realm = os.environ.get('NOSE_WIKI_REALM')
- user = os.environ.get('NOSE_WIKI_USER')
- passwd = os.environ.get('NOSE_WIKI_PASSWD')
- mkwiki(url, realm, user, passwd)
-
if __name__ == '__main__':
main()
diff --git a/scripts/rst2wiki.py b/scripts/rst2wiki.py
new file mode 100644
index 0000000..1a55223
--- /dev/null
+++ b/scripts/rst2wiki.py
@@ -0,0 +1,125 @@
+#!/usr/bin/env python
+
+import sys
+from docutils.nodes import SparseNodeVisitor, paragraph, title_reference, \
+ emphasis
+from docutils.writers import Writer
+from docutils.core import publish_string
+
+class WikiWriter(Writer):
+ def translate(self):
+ visitor = WikiVisitor(self.document)
+ self.document.walkabout(visitor)
+ self.output = visitor.astext()
+
+class WikiVisitor(SparseNodeVisitor):
+
+ def __init__(self, document):
+ SparseNodeVisitor.__init__(self, document)
+ self.list_depth = 0
+ self.list_item_prefix = None
+ self.indent = self.old_indent = ''
+ self.output = []
+ self.preformat = False
+
+ def astext(self):
+ return '\n>>>\n\n'+ ''.join(self.output) + '\n\n<<<\n'
+
+ def visit_Text(self, node):
+ #print "Text", node
+ data = node.astext()
+ if not self.preformat:
+ data = data.lstrip('\n\r')
+ data = data.replace('\r', '')
+ data = data.replace('\n', ' ')
+ self.output.append(data)
+
+ def visit_bullet_list(self, node):
+ self.list_depth += 1
+ self.list_item_prefix = (' ' * self.list_depth) + '* '
+
+ def depart_bullet_list(self, node):
+ self.list_depth -= 1
+ if self.list_depth == 0:
+ self.list_item_prefix = None
+ else:
+ (' ' * self.list_depth) + '* '
+ self.output.append('\n\n')
+
+ def visit_list_item(self, node):
+ self.old_indent = self.indent
+ self.indent = self.list_item_prefix
+
+ def depart_list_item(self, node):
+ self.indent = self.old_indent
+
+ def visit_literal_block(self, node):
+ self.output.extend(['{{{', '\n'])
+ self.preformat = True
+
+ def depart_literal_block(self, node):
+ self.output.extend(['\n', '}}}', '\n\n'])
+ self.preformat = False
+
+ def visit_paragraph(self, node):
+ self.output.append(self.indent)
+
+ def depart_paragraph(self, node):
+ self.output.append('\n\n')
+ if self.indent == self.list_item_prefix:
+ # we're in a sub paragraph of a list item
+ self.indent = ' ' * self.list_depth
+
+ def visit_reference(self, node):
+ if node.has_key('refuri'):
+ href = node['refuri']
+ elif node.has_key('refid'):
+ href = '#' + node['refid']
+ else:
+ href = None
+ self.output.append('[' + href + ' ')
+
+ def depart_reference(self, node):
+ self.output.append(']')
+
+ def visit_subtitle(self, node):
+ self.output.append('=== ')
+
+ def depart_subtitle(self, node):
+ self.output.append(' ===\n\n')
+ self.list_depth = 0
+ self.indent = ''
+
+ def visit_title(self, node):
+ self.output.append('== ')
+
+ def depart_title(self, node):
+ self.output.append(' ==\n\n')
+ self.list_depth = 0
+ self.indent = ''
+
+ def visit_title_reference(self, node):
+ self.output.append("`")
+
+ def depart_title_reference(self, node):
+ self.output.append("`")
+
+ def visit_emphasis(self, node):
+ self.output.append('*')
+
+ def depart_emphasis(self, node):
+ self.output.append('*')
+
+ def visit_literal(self, node):
+ self.output.append('`')
+
+ def depart_literal(self, node):
+ self.output.append('`')
+
+
+def main(source):
+ output = publish_string(source, writer=WikiWriter())
+ print output
+
+if __name__ == '__main__':
+ main(sys.stdin.read())
diff --git a/setup.cfg b/setup.cfg
index 4ef860d..82f3cfb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -11,3 +11,6 @@ with-doctest=1
;;pdb=1
;;pdb-failures=1
;;stop=1
+
+[bdist_rpm]
+doc_files = man/man1/nosetests.1
diff --git a/setup.py b/setup.py
index 35164e1..3f54bc2 100644
--- a/setup.py
+++ b/setup.py
@@ -27,28 +27,35 @@ setup(
author = 'Jason Pellerin',
author_email = 'jpellerin+nose@gmail.com',
description = ('A unittest extension offering automatic test suite '
- 'discovery, simplified test authoring, and output capture'),
- long_description = ('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 magic. '
- 'By default, nose will run tests in files or '
- 'directories under the current working directory '
- 'whose names include "test". nose also supports '
- 'doctest tests and may optionally provide a '
- 'test coverage report.\n\n'
- 'If you have recently reported a bug marked as fixed, '
- 'or have a craving for the very latest, you may want '
- 'the development version instead: '
- 'http://svn.nose.python-hosting.com/trunk#egg=nose-dev'
- ),
+ 'discovery and easy test authoring'),
+ long_description = \
+ """nose extends the test loading and running features of unittest, making
+ it easier to write, find and run tests.
+
+ By default, nose will run tests in files or directories under the current
+ working directory whose names include "test" or "Test" at a word boundary
+ (like "test_this" or "functional_test" or "TestClass" but not
+ "libtest"). Test output is similar to that of unittest, but also includes
+ captured stdout output from failing tests, for easy print-style debugging.
+
+ These features, and many more, are customizable through the use of
+ plugins. Plugins included with nose provide support for doctest, code
+ coverage and profiling, and flexible attribute-based test
+ selection. More information about writing plugins may be found on the
+ wiki, here: http://code.google.com/p/python-nose/wiki/WritingPlugins.
+
+ If you have recently reported a bug marked as fixed, or have a craving for
+ the very latest, you may want the development version instead:
+ http://python-nose.googlecode.com/svn/trunk#egg=nose-dev
+ """,
license = 'GNU LGPL',
keywords = 'test unittest doctest automatic discovery',
url = 'http://somethingaboutorange.com/mrl/projects/nose/',
download_url = \
'http://somethingaboutorange.com/mrl/projects/nose/nose-%s.tar.gz' \
% VERSION,
- package_data = { '': [ '*.txt' ] },
+ data_files = [('man/man1', ['nosetests.1'])],
+ package_data = {'': ['*.txt']},
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
diff --git a/tickets.csv b/tickets.csv
new file mode 100644
index 0000000..f385481
--- /dev/null
+++ b/tickets.csv
@@ -0,0 +1,115 @@
+__color__,__group__,__style__,ticket,summary,component,status,resolution,version,severity,priority,owner,description,modified,_time,_reporter
+3,1.0,font-weight: bold,90,Improve logging config options,nose,new,None,,enhancement,normal,jpellerin,Logging (for nose itself and the packages it tests) config should be more accessible -- esp. it should be possible to configure logging with a standard logging config file. Attachment is a plugin from Oliver Rutherfurd that adds --log-config and --log-filename options. This should be adapted and made part of configure_logging in nose.core.,1158168669,1158168669,jpellerin
+3,1.0,font-weight: bold,85,Is it possible to have more control over TestProgram configuration when running the nose from within python code?,nose,assigned,None,0.9,enhancement,normal,jpellerin,I am trying to use nose with the NoseXML plugin. When I call: nose.run(argv=['--with-nosexml'_'--xml-report-file=some_file'])_ I get my NoseXML output in some_file. This is nice. On the other hand_ it would be nicer if I could specify a StringIO that the NoseXML could write to instead of a file in the filesystem. I have managed to do this by poking around inside the nose.core.TestProgram class and nose.core.configure function_ but my solution is not really acceptable for long-term use. I manually insert a StringIO into the configuration information after argv is parsed and before it is passed to the plugins. Please consider providing a different means for specifying configuration information to nose when it is run using nose.run(). I would be glad to help with this if it would be an acceptable change. And if I've missed the proper way to do something like this_ please let me know. Thanks_ Matthew Desmarais,1156804579,1156793693,q_canada-at-yahoo.com
+3,1.0,font-weight: bold,57,.noserc,nose,assigned,None,1.0,normal,normal,jpellerin,Support reading options from a .noserc file or other config file. Format should be the same as command line args (long form)_ minus the --.,1147630012,1147630001,jpellerin
+3,1.0,color: #777; background: #ddd; border-color: #ccc;,80,provide TestCase methods as functions.,nose,closed,worksforme,0.9,enhancement,normal,jpellerin,Hi First of all I'm new to nose and I like what I see_ I always complained about JUnit/pyUnit because it's too much troubles ... nose takes that away from me. but when I try to test for a method that should raises a certain type of exception I found out that the only way to do this is with TestCase_ at least to catch a certain specific type of test. So how abotu adding a reimplementation (basically transform the methods into functions of TestCase.* into module level nose functions? So we can implement this {{{ class TestMyApp(TestCase): def test_create(self): self.failUnlessRaises(NotImplementedError_ source.create) }}} as {{{ def test_create(): nose.failUnlessRaises(NotImplementedError_ source.create) }}} here is the original thread. http://tinyurl.com/mvssg,1154752873,1154742572,jorge.vargas
+3,1.0,color: #777; background: #ddd; border-color: #ccc;,24,Allow plugins to completely change test output,nose:plugins,closed,fixed,1.0,normal,normal,jpellerin,Currently watcher plugins can report() to add to test output_ but there should be a hook for plugins to take over and do all test output.,1143522249,1143169945,jpellerin
+2,0.9rc1,color: #777; background: #ddd; border-color: #ccc;,27,Missing units,nose,closed,fixed,0.9a1,major,high,jpellerin,Missing unittests for many core functions: * loader testsInModule * loader FunctionTestCase * loader MethodTestCase * LazySuite.run,1151027521,1143519866,jpellerin
+3,0.9b1,color: #777; background: #ddd; border-color: #ccc;,61,Attribute plugin 'OR' test doesn't work,nose:plugins,closed,fixed,0.9a1,normal,normal,jpellerin,nosetests -a tags=a -a tags=b should select tests that have a tags attribute with the value of 'a' or 'b' or a list containing one or both of those values_ but it doesn't.,1148515497,1148351284,jpellerin
+3,0.9b1,color: #777; background: #ddd; border-color: #ccc;,59,nose.tools.raises hides module of original test,nose,closed,fixed,0.9a1,minor,normal,jpellerin,When using nose.tools.raises_ the test reports look like: {{{ nose.tools.<testfunc> }}} Instead of: {{{ <testmod>.<testfunc> }}} raises needs to set the name or module of the wrapper it returns properly.,1148515476,1147897945,jpellerin
+2,0.9b1,color: #777; background: #ddd; border-color: #ccc;,58,ArrtibuteError running nosetests,nose:importer,closed,fixed,0.9a1,normal,high,jpellerin,I'm getting this when running nosetests. Not sure whats causing it_ but I thought someone might be able to point me in the right direction. I will attach the traceback.,1148515456,1147879026,casbon@gmail.com
+3,0.9a2,color: #777; background: #ddd; border-color: #ccc;,54,ignore all executable files?,nose,closed,fixed,0.9,normal,normal,jpellerin, * Is this desirable? (YES) * Is it possible to do_ dependably_ cross-platform? (YES),1147140636,1146622844,jpellerin
+3,0.9a2,color: #777; background: #ddd; border-color: #ccc;,51,nose.collector causes loop when running `setup.py test`,nose,closed,invalid,0.9a1,normal,normal,jpellerin,have a looksee here at my setup.py file: svn co http://svn.testtools.python-hosting.com/trunk --revision=186 testtools I'm using test_suite = "nose.collector" and when I run `setup.py test` with 0.9a1 it gets caught in a loop like so : running test running egg_info writing testtools.egg-info/PKG-INFO writing top-level names to testtools.egg-info/top_level.txt writing manifest file 'testtools.egg-info/SOURCES.txt' running build_ext At revision 186. running test running egg_info writing testtools.egg-info/PKG-INFO writing top-level names to testtools.egg-info/top_level.txt writing manifest file 'testtools.egg-info/SOURCES.txt' running build_ext At revision 186. ... but when I run `nosetests` everything goes smooth. I mentioned in the email that it was working on dev2_ but I meant it was working for other projects. I.E. running `python setup.py test` in etl/trunk/py-lib/ works just fine. I can't see offhand what is different.,1147140543,1146498659,support-forums4@farmdev.com
+3,0.9a2,color: #777; background: #ddd; border-color: #ccc;,53,plugin import errors kill test run,nose:plugins,closed,fixed,0.9,major,normal,jpellerin,Plugin import errors need to be reduced to warnings_ since the import happens before users have a chance to disable the plugin. Example: If profile module is not installed_ nosetests exits with exception without running any tests.,1147140412,1146507699,jpellerin
+3,0.9a2,color: #777; background: #ddd; border-color: #ccc;,52,profile plugin shadows builtin profile module,nose:plugin:profile,closed,fixed,0.9a1,major,normal,jpellerin,It needs a name change_ causes nosetests to fail to load on some platforms.,1147140384,1146507509,jpellerin
+3,0.9a2,color: #777; background: #ddd; border-color: #ccc;,56,wantFunction and wantMethod bugs in attr [patch],nose:plugins,closed,fixed,0.9,normal,normal,jpellerin,this might be better fixed in the loader since I think at least for the wantMethod bug_ it should not get something that's not a method. But this patches was necessary to allow a large ETL suite to run that I'm trying to use attributes in. a patch against branches/0.9-stable is to follow,1146939370,1146843133,Kumar McMillan <support-forums4@farmdev.com>
+3,0.9a2,color: #777; background: #ddd; border-color: #ccc;,55,bug in doctest plugin loadTestsFromPath [patch],nose:plugin:doctest,closed,fixed,0.9a1,normal,normal,jpellerin,we get an iteration error in the doctest plugin when looking at a directory filename (i.e. not a valid .py file). A patch is to follow ...,1146798517,1146669523,support-forums4@farmdev.com
+2,0.9a1,color: #777; background: #ddd; border-color: #ccc;,50,Update mkrelease,nose,closed,fixed,0.9,normal,high,jpellerin,Update mkrelease to make svn/svk branch and tag instead of bzr.,1146441331,1145838610,jpellerin
+4,0.9a1,color: #777; background: #ddd; border-color: #ccc;,4,doc -> wiki,nose,closed,fixed,0.9a1,normal,low,jpellerin,Add a script similiar to mkindex.py that posts doc updates to the right places in this wiki.,1146106486,1141872678,jpellerin
+1,0.9a1,color: #777; background: #ddd; border-color: #ccc;,49,Update docs for 0.9,nose,closed,fixed,0.9,normal,highest,jpellerin, * Update the CHANGELOG and NEWS files. * Update module_ package and class docstrings * Update TestProgram usage * Update mkindex_ make sure it is pulling all relevant info * Update hacking_ etc_ on index to include new svn repos information * Add to this ticket as I think of more doc updates that are needed,1146106433,1145836661,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,37,setuptools integration phase 2: disable plugins,nose:plugins,closed,fixed,0.9,normal,normal,jpellerin,When run under setuptools_ should disable plugins that implement methods that won't get a chance to run (report_ finalize_ prepareTest_ setOutputStream).,1145935337,1144723989,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,48,logging behavior: ignore root logger settings,nose,closed,fixed,0.9,normal,normal,jpellerin,Since nose is likely to be run in unstable environments where users are setting their root or other loggers to debug to debug their own code_ and those users are probably not interested in nose's debug info_ nose should explicitly override the root logger settings in the 'nose' domain. Don't use basicConfig_ but compose a handler and formatter and set the log level to whatever is appropriate for the selected verbosity level.,1145836506,1145667736,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,46,super?,nose,closed,fixed,0.9,normal,normal,jpellerin,Check usage of super() vs direct __init__ calls. Ref: http://fuhm.net/super-harmful/,1145836488,1145372445,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,44,disable attrib plugin eval option for versions < 2.4,nose:plugins,closed,fixed,0.9,normal,normal,jpellerin,eval() can't take an instance in 2.3_ so the attrib eval() option must be disabled in 2.3.,1145836452,1145329766,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,45,Fix tests for 2.3,nose:selftest,closed,fixed,0.9,normal,normal,jpellerin,Many tests are failing under 2.3 due to incompatibile iteration_ etc.,1145496998,1145330134,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,43,nosetests bad_file.py -> greedy loads,nose,closed,fixed,0.9,normal,normal,jpellerin,When given a bad file name_ nosetests loads tests from all modules instead of issuing a warning.,1145210494,1145160913,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,42,nosetests relative/path.py -> no tests loaded,nose,closed,fixed,0.9,normal,normal,jpellerin,Test name resolution for relative filenames is wrong. The files are not loaded.,1145210478,1145160805,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,41,profiler plugin is broken,nose:plugin:profile,closed,fixed,0.9,normal,normal,jpellerin,Trying to run with profiler enabled results in errors from the hotshot stats loader: {{{ Could not identify fileId 10 Could not identify fileId 10 Traceback (most recent call last): File "<stdin>"_ line 1_ in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/hotshot/stats.py"_ line 12_ in load return StatsLoader(filename).load() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/hotshot/stats.py"_ line 29_ in load for event in log: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/hotshot/log.py"_ line 120_ in next filename = self._filemap[fileno] KeyError: 91 }}},1145210457,1145160589,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,40,stop on first error,nose,closed,fixed,0.9a1,normal,normal,jpellerin,Suggestion from Kevin Dangoor: Add an option to stop running tests on the first failure.,1145210422,1144937337,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,36,loader.loadTestsFromNames behavior,nose,closed,fixed,0.9,normal,normal,jpellerin,The test loader's loadTestsFromNames behavior isn't compatible with single-test-file unittest-style command lines_ eg: {{{ python unit_tests/test_loader.py TestNoseTestLoader.test_generate_func }}} It needs to be revised for compatibility with unittest.,1145210398,1144543740,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,34,nose.main signature does not match unittest.main,nose,closed,fixed,0.9,normal,normal,jpellerin,nose.main should be usable interchangably with unittest.main.,1145210364,1144377521,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,33,coverage plugin: option to erase before run,nose:plugin:coverage,closed,fixed,0.9,normal,normal,jpellerin,The coverage plugin should have an option to allow the user to erase accumulated stats before a test run.,1144886539,1144035280,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,32,revise setuptools support_ phase 1,nose,closed,fixed,0.9,normal,normal,jpellerin,To support setuptools test command as best as possible without monkeypatching_ follow PJE's prescription: {{{ #!python class ResultProxy: def addError(self_ test_ err): # reformat err_ adding captured info # then calling addError() on the wrapped result def startTest(self_ test): # code to begin output capture and assertion tracking # then call startTest() on the wrapped result def stopTest(self_ test): # code to end output capture and assertion tracking # then call stopTest() on the wrapped result # ... etc. class TestProxy: def __call__(self_ result): self.wrapped_test(ResultProxy(result)) def shortDescription(self): return self.wrapped_test.shortDescription() }}} The test_suite hook is still better than the test_loader hook_ since test suite can be a function that does other setup; it should configure the system with a setting that deactivates any plugins that can't be supported under this scenario (that is_ any plugin that uses report_ finalize_ prepareTest or setOutputStream),1144723915,1143866267,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,31,nose.tools,nose,closed,fixed,0.9,normal,normal,jpellerin,Create nose.tools module and move with_setup there. Also add: * @raises * @timed And try to think of some more useful_ general test-writing tools to add.,1144723893,1143816999,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,14,test generators for methods do not work,nose,closed,fixed,0.8.7.1,normal,normal,jpellerin,Given the following testclass: class TestSomething(object): def setUp(cls): cls.x = 5 print "setting up" def test_1(self): assert self.x == 4 def test_2(self): assert self.x == 6 def test_3(self): for x in (1_2_7): yield self.check_x def check(self_arg): assert arg %7 ==0 Method test_3 does not function as a proper test generator. What should probably happen is: 1) test_3 generates three separate tests_ just like regular test generators 2) Each of the three tests created by test_3 should get setUp() called when they're called.,1144723873,1142702895,guest
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,25,profiler: output controls,nose:plugin:profile,closed,fixed,0.9,normal,normal,jpellerin,Need controls and options for those controls for the profiler plugin. Including: * formatting options -- sort_ restrict func names_ % of list * prof data filename option (file to store profile data in during run) * print/no print report * print to report stream * output to file ,1144378756,1143170571,jpellerin
+2,0.9a1,color: #777; background: #ddd; border-color: #ccc;,10,document plugin interfaces,nose:plugins,closed,fixed,0.9a1,normal,high,jpellerin,Document the collector_ selector and watcher methods that plugins can implement and where they are called in the process.,1144378682,1142090806,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,22,loading tests from classes: beware subclassing,nose,closed,fixed,0.9,normal,normal,jpellerin,The following case will currently result in wrong behavior: {{{ #!python class TestA: def test_a(self): pass class TestB(TestA): def test_b(self): pass }}} TestB will collect and run both test_a and test_b; it should only run test_a,1144034906,1143162155,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,8,warn on missed test names,nose,closed,fixed,0.9a1,normal,normal,jpellerin,When called with test names on the command line_ eg: {{{ nosetests foo.bar.test }}} nose should track what tests it finds and runs_ and warn at the end if a specified test name was not found. Not sure where to do the tracking.,1144034848,1141916650,jpellerin
+2,0.9a1,color: #777; background: #ddd; border-color: #ccc;,30,pass captured output to plugins,nose:result,closed,fixed,0.9a1,normal,high,jpellerin,In addError and addFailure_ pass captured output (if any) to plugin calls.,1143690219,1143522347,jpellerin
+1,0.9a1,color: #777; background: #ddd; border-color: #ccc;,29,_import failure,nose:importer,closed,fixed,0.9a1,blocker,highest,jpellerin,This import shouldn't be failing in selftest: {{{ ====================================================================== ERROR: test module stpackage.subpak.other.tests in /Users/jhp/projects/nose_work_0.9/st ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/jhp/projects/nose_work_0.9/nose/suite.py"_ line 35_ in run self.setUp() File "/Users/jhp/projects/nose_work_0.9/nose/suite.py"_ line 128_ in setUp self.module = _import(self.moduleName_ [self.path]_ self.conf) File "/Users/jhp/projects/nose_work_0.9/nose/importer.py"_ line 63_ in _import fh_ filename_ desc = find_module(part_ path) ImportError: No module named tests }}},1143690204,1143520279,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,19,watcher plugin API: access to test results,nose:plugins,closed,fixed,0.9a1,normal,normal,jpellerin,make it easier for watcher plugins to access test results... possibly call addError_ etc_ in plugins from TextTestResult.,1143522094,1143041674,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,16,unit tests for plugin option handling,nose,closed,fixed,0.9a1,normal,normal,jpellerin,See #15 for an example of why these are needed. All builtin plugins and builtin options/config need unit tests to ensure that they function as advertised,1143522068,1142723348,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,26,func_names -> funcNames,nose,closed,fixed,0.9a1,minor,normal,jpellerin,Much as I hate camelCase_ unittest uses it and some overridden methods must use it_ so for consistency_ everythingShouldLookLikeThis.,1143434947,1143261806,jpellerin
+1,0.9a1,color: #777; background: #ddd; border-color: #ccc;,23,refactor: revise for better unittest compatibility,nose,closed,fixed,1.0,normal,highest,jpellerin,Refactor implemenation for a better fit with the slots provided. Ideas: * LazySuite replaces collector * Move loading from TestCollector_ TestModule_ etc into loader * Loader gets selector * Loader instantiates LazySuites and passes itself to them Add more details to this ticket.,1143434892,1143162697,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,18,setUpModule doesn't work,nose,closed,fixed,0.8.7.1,normal,normal,jpellerin,In the documentation_ it says you can use 'setUpModule' as the setup function for a module. In the code though_ it actually uses 'setupModule' (note the different case on the 'u'),1143173433,1143040353,guest
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,2,implement profiler plugin,nose:plugin:profile,closed,fixed,0.9a1,normal,normal,jpellerin,Plugin should be a Watcher that outputs a profiler report after test run. Possibly exclude test packages from report_ have a --profile-package argument (like coverage plugin).,1143173411,1141872386,jpellerin
+2,0.9a1,color: #777; background: #ddd; border-color: #ccc;,17,improve library discovery,nose:selector,closed,fixed,0.9a1,normal,high,jpellerin,nosetests deals badly with a common package layout: {{{ pack lib foo.py test test_foo.py }}} To be friendlier to that layout_ selector should be updated to want directories that look like common source directories (lib and src at least). ,1143173374,1142889537,jpellerin
+2,0.9a1,color: #777; background: #ddd; border-color: #ccc;,5,'EOF in multiline input',nose:assert,closed,fixed,0.9a1,normal,high,jpellerin,Assert introspection fails for many expressions with an error like 'EOF in multiline input',1142808065,1141873478,jpellerin
+2,0.9a1,color: #777; background: #ddd; border-color: #ccc;,15,attrib plugin env defaults should not be strings,nose:plugins,closed,fixed,0.9a1,major,high,jpellerin,The attrib plugin is currently broken because the option defaults are strings_ but the option type is append.,1142808025,1142723250,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,9,use logging for messaging,nose,closed,fixed,0.9a1,normal,normal,jpellerin,This will be a 2-step process: 1. replace nose.util.msg() with real logging_ using the builting logging module. 2. provide an interface for selecting which loggers and levels to output and where ,1142483305,1142090654,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,7,add option to activate pdb on error/fail,nose,closed,fixed,0.9a1,normal,normal,jpellerin,Add command line option/env var to activate the pdb on error/fail feature.,1142483270,1141875053,jpellerin
+2,0.9a1,color: #777; background: #ddd; border-color: #ccc;,6,patch AssertionError only,nose,closed,invalid,0.9a1,normal,high,jpellerin,Install the patch that introspects assets as AssertionError only_ instead of patching builtin.Exception.,1142397435,1141873541,jpellerin
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,12,patch: attribute-based test case selector,nose,closed,fixed,0.9a1,normal,normal,jpellerin,This patch adds selecting test cases based on their attributes. Examples of test function/method attribute usage with patched nose Simple syntax (-a_ --attr) examples: * nosetests -a status=stable => only test cases with attribute "status" having value "stable" * nosetests -a priority=2_status=stable => both attributes must match * nosetests -a tags=http => attribute list "tags" must contain value "http" (see test_foobar() below for definition) * nosetests -a slow => attribute "slow" must be defined and its value cannot equal to False (False_ []_ ""_ etc...) * nosetests -a !slow => attribute "slow" must NOT be defined or its value must be equal to False Eval expression syntax (-A_ --eval-attr) examples: * nosetests -A "not slow" * nosetests -A "(priority > 5) and not slow" This example and the accompanied patch is in public domain_ free for any use. ,1142397373,1142193709,guest
+3,0.9a1,color: #777; background: #ddd; border-color: #ccc;,11,patch: Windows path handling issues,nose,closed,fixed,0.9a1,normal,normal,jpellerin,Nose 0.9 r5 fails to run any test cases on Windows. Here's a patch with fixes to some path handling issues. - Mika ,1142179440,1142162540,guest
+2,0.9a1,color: #777; background: #ddd; border-color: #ccc;,3,use clean config in units,nose:selftest,closed,fixed,0.9a1,normal,high,jpellerin,In the unittests in selftest_ each class or instance that can take a config argument should get a fresh _Config()_ so that the configuration of the driving test runner doesn't leak into the test cases.,1142092735,1141872555,jpellerin
+3,0.9.2,font-weight: bold,113,python setup.py nosetests --stop was raise TypeError,nose,assigned,None,0.9,normal,normal,jpellerin,I'm not sure if this would be true across all extra options sent to setup.py nosetests_ however the fix seemed simple enough (the internals needed to handle integer values). A rough patch is following (this got it working). All this_ using nose revision 143 and setuptools 0.6c3,1166026105,1165886115,kumar dot mcmillan / gmail
+3,0.9.2,font-weight: bold,110,isolation plugin,nose:plugins,assigned,None,,enhancement,normal,jpellerin,Include a plugin in core that resets the state of sys.modules between after each test module is run.,1165080721,1165080713,jpellerin
+3,0.9.2,font-weight: bold,109,doctest vs coverage,nose:plugin:doctest,assigned,None,,normal,normal,jpellerin,doctest requires a patch (or monkeypatch) to work correctly with the coverage module. ref: http://www.nedbatchelder.com/code/modules/coverage.html http://svn.zope.org/Zope3/trunk/src/zope/testing/doctest.py?rev=28679&r1=28703&r2=28705 Since nose can't patch a user's doctest directly_ we'll have to monkeypatch in a revise _OutputRedirectingPdb.,1165003349,1165003342,jpellerin
+3,0.9.2,font-weight: bold,108,Generate and post plugin docs,nose:plugins,assigned,None,,normal,normal,jpellerin,Generate HTML docs for built-in plugins and post them to the site and wiki.,1164209462,1164209456,jpellerin
+3,0.9.2,font-weight: bold,106,Revise long description in setup.py,nose,assigned,None,,normal,normal,jpellerin,Revise the long description in setup.py to be more accurate and descriptive.,1164124115,1164124107,jpellerin
+3,0.9.2,font-weight: bold,100,nosetests man page,nose,assigned,None,,enhancement,normal,jpellerin,Install a man page for nosetests on install. A man page contributed by Gustavo Noronha Silva is attached to this ticket.,1162073265,1162073165,jpellerin
+4,0.9.2,font-weight: bold,112,test can't be run from package directory -- misleading INFO message,nose,assigned,None,,normal,low,jpellerin,I have a small module_ i.e. a dir (say_ package/) which has an __init__.py_ a foo.py and a test_foo.py test_foo.py has the line 'import foo' in it_ as it contains the test code for the code in foo.py I try to run the tests by running 'nosetests -vv' in the dir. I see the line "nose.core: INFO: Working directory is a package; adding to sys.path" appear_ but the tests won't run_ I get an ImportError: No module named foo The problem is that the message "Working directory is a package; adding to sys.path" is misleading. I doesn't add the current directory_ it adds the _parent_ of the current directory to sys.path. (Due to the way add_path() is implemented in sys.path) I'm not sure how to characterise this problem. Simply having 'import package.foo' instead of 'import foo' in test_foo.py makes it work. Is there any reason to prohibit using 'import foo' in this case? Or maybe using add_path() for adding the current working directory is a bug? ,1166026048,1165855566,guest
+4,0.9.2,font-weight: bold,102,Nose frontpage installation instructions in error,nose,assigned,None,0.9.1,minor,low,jpellerin,These instructions are wrong: {{{ Install nose using setuptools: easy_install nose Or_ if you don't have setuptools installed_ use the download link at right to download the source package_ and install in the normal fashion: Ungzip and untar the source package_ cd to the new directory_ and: python setup.py install }}} You cannot run python setup.py install without setup_tools upgraded to at least the version that nose is configured to work with_ as per this error message: {{{ $ sudo python setup.py install ~/src/nose-0.9.1 The required version of setuptools (>=0.6c2) is not available_ and can't be installed while this script is running. Please install a more recent version first. (Currently using setuptools 0.6c1 (/usr/lib/python2.4/site-packages/setuptools-0.6c1-py2.4.egg)) zsh: 32149 exit 2 sudo python setup.py install }}} I recommend ammending the instructions to say {{{ python ez_setup.py python setup.py install }}} and note that the installation will cause easy_install to be installed. Perhaps a link to ez_setup.py would be good too.,1162913345,1162769184,stephen@thorne.id.au
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,95,evaluating asserts stops working when there is a two-line docstring,nose,closed,fixed,0.9,normal,normal,jpellerin,This is a problem with nose version 0.9.0. When I run the following test with nosetests -d option_ def test_integers(): a = 2 assert a == 4 I get this expected result_ the variable a is expanded: ... assert a == 4 AssertionError 2 = 2 >> assert 2 == 4 However_ when I add a two-line docstring like that: def test_integers(): """docstring line 1 docstring line 2 """ a = 2 assert a == 4 then_ instead of the variable expansion_ the last line of the docstring is displayed: ... assert a == 4 AssertionError docstring line 2,1165448121,1159996887,cito@online.de
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,101,Doesn't select decorated methods/functions,nose:selector,closed,invalid,0.9,normal,normal,jpellerin,If a function has a decoration nose will not pick it up for testing_ it is of type 'function proxy' instead of 'function'. This was tested on Debian testing with version 0.9.0-1 Test case: {{{ def my_decor(func): return lambda: func() def test_decor(): assert False @my_decor def test_decor1(): assert False }}} In the above test case we have two functions_ one decorated and one not. Running it through nosetests shows only one detected function which fails while we expect two functions failing. Running it in verbose mode will show that test_decor1 is not picked up for testing.,1165359172,1162414927,guest
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,111,nosetests -vvvv produces little output,nose,closed,fixed,,minor,normal,jpellerin,You get more output with -v_ -vv_ and -vvv -- but with -vvvv the output goes away,1165358579,1165343732,ianb@colorstudy.com
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,105,nose 0.9.1 does not run functional tests in order of appearance in the module,nose:collector,closed,fixed,0.9.1,normal,normal,jpellerin,In nose main page_ http://somethingaboutorange.com/mrl/projects/nose/_ the section titled **Writing tests** says: [quote] Like py.test_ functional tests will be run in the order in which they appear in the module file. TestCase derived tests and other test classes are run in alphabetical order. [endquote] nose 0.9.1 does not seem to do this at all. It seems that it performs the tests in the following order: - run test functions that are defined with the raises decorator - runs the other test functions in alphabetical order of the test function names py.test does run the test functions in order of appearance in the module and I'd like to be able to depend on that when using nose. ,1165357838,1163710775,prouleau001@gmail.com
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,79,ability to change the regex pattern ,nose,closed,fixed,0.9,enhancement,normal,jpellerin,hello_ i just started using nose and i've read the help but can't find a setting to customize the discovery regex. was hoping it would discover tests named with our standard naming system: something like 'modulename_unittest.py'. could this functionality be added?,1165355366,1154476080,guest
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,107,Expose the guts of @raises as assert_raises,nose,closed,fixed,,enhancement,normal,jpellerin,@raises is useful for some users_ but others want to be able to stack up several raises tests inside of one test case_ so it would be helpful to have an assert_raises that they can call directly.,1165354930,1164208688,jpellerin
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,39,setuptools integration: pick up options from setup.cfg,nose,closed,fixed,0.9,normal,normal,jpellerin,Suggestion from Kevin Dangoor: {{{ Even if hooking into setuptools' test command doesn't work_ would it be possible for you to make a distutils command wrapper (setuptools allows you to easily plug in new commands). The reason I say this is that nosetests has a growing set of options_ and it would be nice to be able to specify the right set of options in setup.cfg. }}} First need to figure out what this will require and from that decide the appropriate milestone.,1163907814,1144937275,jpellerin
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,38,setuptools integration phase 3: custom command,nose,closed,fixed,0.9,normal,normal,jpellerin,Create a setuptools command that exposes the full functionality of nose and all plugins.,1163907793,1144724045,jpellerin
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,99,integrated twisted with nose,nose,closed,fixed,,enhancement,normal,jpellerin,Here is the Twisted integration source code. twistedtools.py is the implementation itself (I first tried to call it "twisted"_ but then it shadows the original twisted package). It allows to decorate tests that return a Deferred. test_twisted.py is the test suite for the implementation. There probably should be a way to skip it if Twisted is not installed (instead of raising ImportError all around)_ but I don't know the right way to do that. ,1163385473,1161798402,guest
+3,0.9.2,color: #777; background: #ddd; border-color: #ccc;,92,@with_setup doesn't mix well with @raises,nose,closed,fixed,0.9,major,normal,jpellerin,Hi_ I tried to write the following code: @raises(NotEnoughBytes) @with_setup(setup1) def test32(): ... This failed in a strange way. It seems nose either called the wrong setup function (I have different setup functions for different tests)_ or didn't call one at all (I didn't investigate very far). The fix came by inverting the decorator order: @with_setup(setup1) @raises(NotEnoughBytes) def test32(): ... ,1163385442,1159199576,guest
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,98,@with_setup not calling teardown() if test raises exception,nose,closed,worksforme,0.9.1,normal,normal,jpellerin,I'm not sure if this is desired behvior or not_ but I noticed that if a test function decorated with @with_setup() raises an exception then the teardown() method is not called. My personal choice is that a teardown function is called in a finally block as the test is run_ to *always* undo what was done by setup. I took a [very] quick stab at adding a test to nose's suite for this but couldn't come up with one since setup and teardown are just properties set on the test method. hmm. Was using revision 98. -Kumar McMillan,1161544724,1160681294,support-forums4@farmdev.com
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,94,--doctest-extension and NOSE_DOCTEST_EXTENSION conflict,nose,closed,fixed,0.9,normal,normal,jpellerin,If you define both the environmental variable and give the command-line variable_ you get: {{{ Traceback (most recent call last): File "/usr/local/bin/nosetests"_ line 7_ in ? sys.exit( File "/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py"_ line 438_ in main return sys.exit(not run(*arg_ **kw)) File "/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py"_ line 446_ in run result = TestProgram(*arg_ **kw).success File "/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py"_ line 199_ in __init__ self.parseArgs(argv_ env) File "/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py"_ line 206_ in parseArgs self.conf = configure(argv_ env) File "/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py"_ line 322_ in configure options_ args = parser.parse_args(argv) File "/usr/lib/python2.4/optparse.py"_ line 1278_ in parse_args stop = self._process_args(largs_ rargs_ values) File "/usr/lib/python2.4/optparse.py"_ line 1318_ in _process_args self._process_long_opt(rargs_ values) File "/usr/lib/python2.4/optparse.py"_ line 1393_ in _process_long_opt option.process(opt_ value_ values_ self) File "/usr/lib/python2.4/optparse.py"_ line 710_ in process return self.take_action( File "/usr/lib/python2.4/optparse.py"_ line 723_ in take_action values.ensure_value(dest_ []).append(value) AttributeError: 'str' object has no attribute 'append' }}},1160517146,1159410819,ianb@colorstudy.com
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,93,try:except: around inspect.getargspec,nose,closed,fixed,,normal,normal,jpellerin,I got this exception from the collector: {{{ File "/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/util.py"_ line 163_ in try_run args_ varargs_ varkw_ defaults = inspect.getargspec(func) File "/usr/lib/python2.4/inspect.py"_ line 670_ in getargspec raise TypeError('arg is not a Python function') }}} nose should catch this and tell more about what "func" really is.,1160517077,1159402148,ianb@colorstudy.com
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,96,Names of modules in test packages ,nose,closed,worksforme,,minor,normal,jpellerin,Test packages are not documented very well. It seems all modules living in a test package are automatically considered test modules_ irrespective whether their names match the testMatch regular expression or not. Is this by design? At least it should be documented.,1160517012,1160000430,guest
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,91,python 2.5: assert introspection: different line counts,nose:assert,closed,fixed,0.9.1,minor,normal,jpellerin,In python 2.5_ some assert introspection tests fail because the traceback source analyzer comes back with different line numbers sometimes than it does in 2.4.,1158692189,1158686657,jpellerin
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,76,No handlers for logger spam,nose,closed,fixed,0.9.1,minor,normal,jpellerin,No handlers could be found for logger "nose.plugins" is spammed to the console sometimes(?) on startup.,1157561941,1153497636,jpellerin
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,86,python version detection broken for 3.0 and above,nose:plugins,closed,fixed,0.9.1,minor,normal,jpellerin,From Kevin Dangoor: {{{ in nose/plugins/attrib.py: compat_24 = pyvrs[0] >= 2 and pyvrs[1] >= 4 would fail with Python 3.0 (though all bets are off for compatibility there anyhow :) Python version detection actually had a discussion on the tg list a few months back. you can rewrite this: compat_24 = sys.version_info >= (2_ 4) }}},1157560233,1157033334,jpellerin
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,81,/lib -style package organization broken,nose,closed,fixed,0.9.1,normal,normal,jpellerin,When a package is organized like: {{{ /lib module.py /tests test_module.py }}} nose loads test_module but even though it has already seen lib_ it has failed to put it on sys.path_ unless a plugin has asked to load all modules. Possible solution: when addPaths is on_ always add the surrounding directory of any .py file we see. ,1156471920,1155046975,jpellerin
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,83,-x/--stop stops on skipped tests,nose,closed,fixed,0.9,normal,normal,jpellerin,the -x/--stop option will stop on a skipped test even though that's not really an error. I haven't tested the others like deprecated tests. Tested w/ version 0.9.0 only.,1156465750,1156456277,kumar mcmillan <support-forums5@farmdev.com>
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,75,Multiple --include arguments should 'OR' not override,nose:selector,closed,fixed,0.9.1,normal,normal,jpellerin,Multiple --include arguments should result in everything that matches any of them being included_ instead of the current behavior_ which is that only the last --include issued is used.,1156361851,1153497496,jpellerin
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,78,option for coverage to include all .py files,nose,closed,fixed,0.9,enhancement,normal,jpellerin,Coverage reported by the coverage plugin can be misleading. Files not imported by the test suite will not be reported_ thereby making the coverage appear larger. This patch adds a --cover-inclusive option that will cause all .py files (matching --cover-package if existing) under the working directory to be included in the report.,1155046277,1154185738,James Casbon (casbon@gmail.com)
+2,0.9.1,color: #777; background: #ddd; border-color: #ccc;,72,package.mod:Class doesn't select all tests in class,nose:selector,closed,fixed,0.9,normal,high,jpellerin,It looks like package.mod:Class is broken; it doesn't select all of the tests in the class -- it selects nothing.,1154122686,1152203791,jpellerin
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,74,Possible bug in subpackage_of,nose:selector,closed,fixed,0.9,normal,normal,jpellerin,I was using 0.9b2 earlier without problems_ but after upgrade to 0.9 "python setup.py test" command doesn't work anymore. My directory structure is (full avaiable here: http://pycheesecake.org/browser/branches/mk): {{{ cheesecake/ ... README setup.py tests/ unit/ functional/ data/ }}} Running "nosetests --with-doctest --doctest-tests --include unit --verbose" runs all of the tests in "tests/unit" along with doctests found in package code. But using nose.collector by setup.py script runs only one doctest from the "tests/unit/" directory (so it omits all unit tests and doctests in project directory "cheesecake/"). Our setup.py config is avaiable here: http://pycheesecake.org/browser/branches/mk/setup.py . By browsing through the diff of 0.9b->0.9.0 I've found out that part of code that makes a difference is inside new subpackage_of() function. If you omit comparisons of "mod_parts" and "pkg_parts" (lines 369-379) nose.collector works just like in 0.9b running all of my unit and doc tests.,1153497668,1153338646,constant.beta@gmail.com
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,60,Add function that works like unittest.main(): collects tests in __main__ only,nose,closed,fixed,0.9.1,normal,normal,jpellerin,Add a function to core that works like unittest.main_ that is_ collects test in main only. Usage would be like: {{{ #!python import nose def test_a(): pass def test_b(): pass if __name__ == '__main__': nose.runtests() }}} ,1152755792,1147900584,jpellerin
+3,0.9.1,color: #777; background: #ddd; border-color: #ccc;,62,Allow multiple -w arguments,nose,closed,fixed,0.9.1,normal,normal,jpellerin,nosetests should allow multiple -w arguments to include multiple test roots in one run.,1152753796,1148516107,jpellerin
+1,0.9.1,color: #777; background: #ddd; border-color: #ccc;,73,nose.collector not finding all tests in `setup.py test`,nose,closed,fixed,0.9,critical,highest,jpellerin,using nose-0.9.0-py2.4.egg ... I'm getting some strange behavior trying to run `python setup.py test` It only finds my doctests. However_ if I run `nosetests -v --with-doctest --doctest-tests` all tests are found. In setup.py I am setting the env vars which would be the equivalent of the above command line options_ i.e. {{{ os.environ['NOSE_WITH_DOCTEST'] = '1' os.environ['NOSE_DOCTEST_TESTS'] = '1' }}} I will dig around the code a little more to see if I can figure out where it's going wrong_ but wanted to submit this ticket in the meantime since you might know where to look in nose.collector here is how to reproduce : {{{ svn co --revision 197 http://svn.testtools.python-hosting.com/trunk testtools cd testtools python setup.py test }}} and this is what I was expecting : {{{ nosetests -v --with-doctest --doctest-tests }}} am I missing anything?,1152716057,1152223849,support-forums5@farmdev.com
+3,0.9,color: #777; background: #ddd; border-color: #ccc;,71,nosetests -s results in IOError: [Errno 29] Illegal seek,nose,closed,worksforme,0.9,normal,normal,jpellerin,I do: {{{ $ nosetests -s }}} and get: {{{ Traceback (most recent call last): File "/usr/bin/nosetests"_ line 7_ in ? sys.exit( File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py"_ line 434_ in main return sys.exit(not run(*arg_ **kw)) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py"_ line 442_ in run result = TestProgram(*arg_ **kw).success File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py"_ line 201_ in __init__ self.runTests() File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py"_ line 229_ in runTests result = self.testRunner.run(self.test) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py"_ line 100_ in run result = unittest.TextTestRunner.run(self_ test) File "/usr/lib/python2.4/unittest.py"_ line 696_ in run test(result) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 40_ in __call__ self.run(*arg_ **kw) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 54_ in run test(result) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 40_ in __call__ self.run(*arg_ **kw) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 54_ in run test(result) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 40_ in __call__ self.run(*arg_ **kw) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 54_ in run test(result) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 40_ in __call__ self.run(*arg_ **kw) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 54_ in run test(result) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 40_ in __call__ self.run(*arg_ **kw) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py"_ line 54_ in run test(result) File "/usr/lib/python2.4/unittest.py"_ line 281_ in __call__ return self.run(*args_ **kwds) File "/usr/lib/python2.4/unittest.py"_ line 276_ in run if ok: result.addSuccess(self) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/result.py"_ line 176_ in addSuccess Result.addSuccess(self_ test) File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/result.py"_ line 83_ in addSuccess self.resetBuffer() File "/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/result.py"_ line 104_ in resetBuffer sys.stdout.truncate(0) IOError: [Errno 29] Illegal seek }}} using nose patch 68 from SVN under Ubuntu Dapper (6.06). Not sure why the egg is labeled dev_r63_ but it's definiately patch 68. ,1151775330,1151499339,guest
+3,0.9,color: #777; background: #ddd; border-color: #ccc;,70,Missing file warning spam,nose:selector,closed,fixed,0.9,normal,normal,jpellerin,The missing file warning repeats once for every test file compared against a requested missing file. It would be better to output only once per run per missing file.,1151720295,1151071138,jpellerin
+3,0.9,color: #777; background: #ddd; border-color: #ccc;,69,All python files are executable on windows,nose,closed,fixed,0.9,normal,normal,jpellerin,On Windows (or at least my version of Windows XP) all newly created .py files are executable. That is_ os.access(myFilePath_ os.X_OK) returns True for all of my .py files. This means that the default behaviour of omitting executable files unless --exe is set causes doctests in non-test modules to not run on Windows. This happens because non-test modules get checked with wantFile() rather than wantModule() and get ignored becuase there are executable. This bug is hidden slightly at the moment because the sense of --exe is currently reversed - see #68. Currently the doctests are omitted when --exe is used. After #68 is fixed they will be omitted when --exe is ''not'' used. ,1151720276,1150107090,richard@artsalliancemedia.com
+3,0.9,color: #777; background: #ddd; border-color: #ccc;,21,add unittests for lunatic objects,nose:selector,closed,fixed,0.9,normal,normal,jpellerin,Add unittests for weirdo calls that might come up_ such as calling want_function() with something that doesn't have a {{{__name__}}}.,1151028415,1143081832,jpellerin
+3,0.9,color: #777; background: #ddd; border-color: #ccc;,1,coverage output for single tests,nose:plugin:coverage,closed,fixed,0.9,normal,normal,jpellerin,Ran: {{{ python nose/core.py -vvvvv -w st/unit_tests --with-coverage --cover-package=nose test_selector }}} Expected: coverage output Actual: no coverage output,1150943529,1141872205,jpellerin
+3,0.9,color: #777; background: #ddd; border-color: #ccc;,68,The meaning of '--exe' is backwards,nose:selector,closed,fixed,0.9,normal,normal,jpellerin,the command line option '--exe' is documented as causing more files to be included. Therefore it should '''increase''' the number of tests run. In my tests adding this option actually decreases the number of tests run. {{{ C:\data\code\aa\Newman\POS\gui>python "c:\Program Files\Python23\Scripts\nosetes ts-script.py" -d --with-doctest --doctest-tests -v doctest of DialogExceptHook.DialogExceptHook ... ok ---------------------------------------------------------------------- Ran 1 test in 0.359s OK C:\data\code\aa\Newman\POS\gui>python "c:\Program Files\Python23\Scripts\nosetes ts-script.py" -d --with-doctest --doctest-tests -v --exe ---------------------------------------------------------------------- Ran 0 tests in 0.015s OK }}} I think I've tracked this down to the following code starting on line 241 of source:branches/0.9-stable/nose/selector.py#40 {{{ #!python if not self.conf.ignoreExe and os.access(file_ os.X_OK): log.info('%s is executable; skipped'_ file) return False }}} that 'not' looks like it should not be there. ,1150943322,1150105257,richard@artsalliancemedia.com
+2,0.9,color: #777; background: #ddd; border-color: #ccc;,66,specifying test names causes repeat imports,nose:importer,closed,fixed,,major,high,jpellerin,Specifying test names can change nose's behavior in extremely strange ways. For The attached test case_ the following all produce different import behavior_ in some cases resulting in repeat imports of modules in sys.modules: {{{ nosetests -w zz nosetests nosetests test_model nosetests -w zz test_model }}},1150942667,1149777393,jpellerin
+3,0.9,color: #777; background: #ddd; border-color: #ccc;,63,TypeError: iteration over non-sequence,nose:plugin:doctest,closed,fixed,0.9,blocker,normal,jpellerin,This exception is thrown when running: {{{ nosetests --with-doctest . }}} And it's thrown by trying to iterate over the result of DocTest.py::loadTestsFromPath()_ which returns None. My expectation (although I've only read the code diagonally)_ is for loadTestsFromModule() to find my doctests_ and loadTestsFromPath() to be used for loading doctests from other places. I really haven't understood the purpose of loadTestsFromPath()_ have I? I'll attach a patch right away_ but I'm afraid I'm only masking the error somehow; please do look it over to see if that is what's correct.,1150942371,1149021094,lbruno@republico.estv.ipv.pt
+3,0.9,color: #777; background: #ddd; border-color: #ccc;,35,profiler: output to stream or file,nose:plugin:profile,closed,fixed,0.9,normal,normal,jpellerin,The profiler plugin should be able to output to the results stream or a selected file.,1145210384,1144380238,jpellerin
+2,0.9,color: #777; background: #ddd; border-color: #ccc;,28,Missing units,nose,closed,duplicate,0.9a1,major,high,jpellerin,Missing unittests for many core functions: * loader testsInModule * loader FunctionTestCase * loader MethodTestCase * LazySuite.run,1143521867,1143519867,jpellerin
+1,0.10,font-weight: bold,104,rewrite test loading/importing/suites to be easier to follow,nose,assigned,None,0.9.1,normal,highest,jpellerin,The code for test loading_ suites and imports is convoluted and difficult to follow. It should be simplified and clarified.,1163785969,1163457944,jpellerin
+2,0.10,font-weight: bold,103,Run fictures (setup/teardown) only for modules or packages that contain tests,nose,reopened,,0.9.1,major,high,jpellerin,my directory structure: {{{ proj/module1/__init__.py(has setup/teardown) module1.py proj/module2/__init__.py(has setup/teardown) module2.py }}} When I run below in proj dir: nosetests module1 -vv I found although only module1.py is running but both module1 package setup/teardown and module2's has run. that means I have to run: nosetests module1 -e module2 to exclude module2. is there a way to run module1 package's test only? I know I could run `nosetest -w module1`_ but this way can't call package setup/teardown. ,1165436116,1163345588,guest
+3,0.10,font-weight: bold,89,would like common interface for all test wrapper objects,nose,assigned,None,,enhancement,normal,jpellerin,It would be convenient/efficient/and future-safe to access all of nose's internal test wrappers with a common interface. That is_ convenient for the nose-watch plugin ;) Here is an initial idea_ open to suggestions. I should point out that these are the only things that nose-watch needs to access_ so a complete interface might want more. * wrapper.getTestObject() * the actual test (i.e. !FunctionTestCase.testFunc or !TestModule.module or unittest.!TestCase._'_class_'_) * wrapper.getTestFile() * this one has proven itself really tricky and maybe nose has a better way to do it since it is already looking for tests in the filesystem. Currently I am working around unloadable modules by overloading the load_source() method in ihooks.Hooks. There is also a big problem that I'm not sure is solvable in aliased modules (i.e. "from main import foo" when when foo.py exists in main/foo/foo.py_ concealed by main/foo/__init__.py). I think inspect.getfile() is the one to blame for that_ but I haven't looked into it too far other than knowing it's not working how I would like it. * wrapper.getTestAddress() * get a string "address" of a test. That is_ a name that could be put on the command line of a nosetests call to run this test again. I'm thinking that any unittest.!TestCase method could only return the filename of its module? We should talk before you start work on this ... or perhaps I will just add a patch or two to this ticket if I get around to it first. I'll wait until 0.9.1 is out the door.,1164123000,1158004717,kumar mcmillan <support-forums5@farmdev.com>
+3,0.10,font-weight: bold,84,Generator tests with mutable arguments = bad,nose,assigned,None,,normal,normal,jpellerin,From Kevin Dangoor: {{{ A coworker found an interesting bug in test generators. Apparently_ py.test does the same thing. Maybe this is architecturally difficult to contend with. Here's the test: #! /usr/bin/env python def test_list_loop(): def check_list_loop(ls_ len_expected): print ls assert len(ls) == len_expected ls = list() for i in range(0_ 6): ls.append(i) yield check_list_loop_ ls_ i + 1 It appears that each yielded test is not run immediately_ but is collected up and *then* run. In this particular case_ that fails because a mutable object is involved (and mutated as part of the test running). Changing that last line to yield check_list_loop_ ls[:]_ i + 1 makes it work_ because you're dealing with copies of the list each time. }}},1164123047,1156525484,jpellerin
+2,,font-weight: bold,13,update selftest.py,nose:selftest,assigned,None,,normal,high,jpellerin,Update selftest to account for the new tests in units and unit support.,1151019152,1142483367,jpellerin
+3,,font-weight: bold,114,nosetests 0.9.1 leaks 0-byte temporary files under Windows,nose,new,None,0.9.1,normal,normal,jpellerin,I just noticed that nosetests 0.9.1 creates and leaves behind one temporary file each time it executes_ running a test. Under Windows_ the file are left in C:\Windows\Temp and have names similar to tmpxxxxx. It is probably a file name created by tempfile module function somewhere. These files should be deleted when nosetests terminates. I am not running any plugins. The test is very simple. Even an empty test creates a temp file leak. ,1166407315,1166407315,guest
+3,,font-weight: bold,47,optimize startup time for lib/ test/ and package/ test/ cases,nose,assigned,None,,normal,normal,jpellerin,Startup time for layouts like: - lib/ - test/ Or: - package/ - test/ Is very bad_ since nose examines everyting in package/ and lib/ before looking in test/. This should be fixable_ since it's only looking in the libs first to be sure that their root dirs are in sys.path before the tests are loaded.,1151019121,1145372575,jpellerin
+3,,color: #777; background: #ddd; border-color: #ccc;,97,@with_setup not calling teardown() if test raises exception,nose,closed,duplicate,0.9.1,normal,normal,jpellerin,I'm not sure if this is desired behvior or not_ but I noticed that if a test function decorated with @with_setup() raises an exception then the teardown() method is not called. My personal choice is that a teardown function is called in a finally block as the test is run_ to *always* undo what was done by setup. I took a [very] quick stab at adding a test to nose's suite for this but couldn't come up with one since setup and teardown are just properties set on the test method. hmm. Was using revision 98. -Kumar McMillan,1161534207,1160681280,guest
+3,,color: #777; background: #ddd; border-color: #ccc;,87,nose-django fails for apps with no models.py,nose:plugins,closed,fixed,,normal,normal,jpellerin,nose-django fails at nosedjango.py line 141_ for any app which has no models.py (e.g. django/contrib/markup) Since it's not required to have a models.py file in every app_ should begin() protect itself_ e.g. only run management.install where load_app(app) is not None ? or you could say it's a fault in django. a blank models.py fixes it. ,1157559960,1157443138,guest
+3,,color: #777; background: #ddd; border-color: #ccc;,88,call to debug log raises IndexError,nose,closed,fixed,0.9.1,normal,normal,jpellerin,some straggler debug code from a condition yet to be evaluated is raising an IndexError. This is in selector.py_ revision 94. Here is a patch.,1157559860,1157468103,Kumar McMillan <support-forums4@farmdev.com>
+3,,color: #777; background: #ddd; border-color: #ccc;,82,NameError in class def *only* when running nosetests,nose,closed,invalid,0.9.1,normal,normal,jpellerin,I could be missing something obvious_ but this has me completely stumped. I figure you know more about the environment that nose imports code into so_ I dunno_ take a look and let me know what you think. Try this: {{{ svn co --revision=238 http://svn.testtools.python-hosting.com/trunk/ testtools_238 cd testtools_238 nosetests -v testtools/testself/test_fixtures/test_storable.py }}} all tests should pass. now_ open up testtools/testself/test_fixtures/test_storable.py and edit a few things : * change mknewfile2 on line 241 to mknewfile * change mknewfile2 on line 249 to mknewfile now run it again and you should get : {{{ Traceback (most recent call last): File "/Users/kumar/tmp/tt_nose_flop/testtools/testtools/testself/test_fixtures/test_storable.py"_ line 246_ in test_mknewfile class MyAutoCsv(CsvFixture): File "/Users/kumar/tmp/tt_nose_flop/testtools/testtools/testself/test_fixtures/test_storable.py"_ line 247_ in MyAutoCsv class meta: File "/Users/kumar/tmp/tt_nose_flop/testtools/testtools/testself/test_fixtures/test_storable.py"_ line 249_ in meta mknewfile = mknewfile NameError: name 'mknewfile' is not defined }}} now ... to make sure we're all sane_ shouldn't the exact same error happen when we simply compile the code? {{{ python testtools/testself/test_fixtures/test_storable.py }}} Yet it does not. In addition_ I have tried to reproduce a similar NameError in the python shell without success. And I've also tried taking that test function out of the unittest.TestCase class so that it is a standalone def_ it still failed. I guess it's some kind of referencing issue but I can't think of any reason why this could happen *only* in nose. - kumar,1156464833,1155846492,guest
+3,,color: #777; background: #ddd; border-color: #ccc;,77,Importer bug for modules starting with underscore,nose:importer,closed,invalid,0.9.1,normal,normal,jpellerin,I will paste the session dump that presents the issue here. Files needed to reproduce this in attachement. {{{ $ nosetests --verbose --include \(unit\)\|\(functional\) No handlers could be found for logger "nose.plugins" test_from_functional.TestFunctional.test_functional ... ok ERROR ====================================================================== ERROR: test module test_from_unit in /tmp/blah/tests/unit ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/nose-0.9.1.dev_r77-py2.3.egg/nose/suite.py"_ line 44_ in run self.setUp() File "/usr/lib/python2.3/site-packages/nose-0.9.1.dev_r77-py2.3.egg/nose/suite.py"_ line 187_ in setUp self.module = _import(self.moduleName_ [self.path]_ self.conf) File "/usr/lib/python2.3/site-packages/nose-0.9.1.dev_r77-py2.3.egg/nose/importer.py"_ line 96_ in _import mod = load_module(fqname_ fh_ filename_ desc) File "/tmp/blah/tests/unit/test_from_unit.py"_ line 1_ in ? from _helper import fun1 ImportError: cannot import name fun1 ---------------------------------------------------------------------- Ran 1 test in 0.006s FAILED (errors=1) $ nosetests --verbose --include unit No handlers could be found for logger "nose.plugins" test_from_unit.TestUnit.test_unit ... ok ---------------------------------------------------------------------- Ran 1 test in 0.004s OK $ nosetests --verbose --include functional No handlers could be found for logger "nose.plugins" test_from_functional.TestFunctional.test_functional ... ok ---------------------------------------------------------------------- Ran 1 test in 0.004s OK }}},1154748574,1153500759,constant.beta@gmail.com
+3,,color: #777; background: #ddd; border-color: #ccc;,67,Hard to embed tests in existing modules,nose:collector,closed,wontfix,,enhancement,normal,jpellerin,I often like to put a few tests in my Python modules_ and it would be nice to use 'nosetests' on them. However_ nosetests fails to discover any tests because the modules aren't named test_*. Can we have a command-line option that looks for tests in the specified module regardless of its name? I tried making the module executable and using --exe but that didn't work.,1150933585,1149892677,sluggoster@gmail.com
+3,,color: #777; background: #ddd; border-color: #ccc;,65,help text in doctest module inaccurate,nose:plugin:doctest,closed,fixed,,minor,normal,jpellerin,... it's just missing the env vars in the help text even though they were being accessed already. (see patch),1149209864,1149178821,Kumar McMillan <support-forums4@farmdev.com>
+3,,color: #777; background: #ddd; border-color: #ccc;,64,activate non nose loggers through --debug,nose,closed,fixed,,normal,normal,jpellerin,I think that you should be able to activate other loggers for your application through --debug. Imagine I am unit testing a piece of code that uses the logger "application.component". Now_ in the normal run of the application the handler for this is set up by some piece of code that is not being run during the unit test. However_ the unit tests fail_ and I want to quickly activate the logger so I can see what went wrong. I think I should be able to write "nosetests ---debug=application.component" and see the log messages. I have attached a patch that fixes this. ,1149209839,1149119240,casbon@gmail.com
+2,,color: #777; background: #ddd; border-color: #ccc;,20,nose 0.8.7.1 fails with TurboGears tests,nose,closed,fixed,0.8.7.1,normal,high,jpellerin,Running nosetests from the toplevel directory of a TurboGears trunk checkout fails after this: {{{ Full path to turbogears.fastdata.tests.formmodel is /Users/tazzzzz/projects/turbogears/turbogears.fastdata.tests.formmodel test 'turbogears.fastdata.tests.formmodel' resolves to 'turbogears.fastdata.tests.formmodel' in '/Users/tazzzzz/projects/turbogears' (<class 'nose.core.TestModule'>) running test test module turbogears.fastdata.tests.formmodel in /Users/tazzzzz/projects/turbogears Import turbogears.fastdata.tests.formmodel from /Users/tazzzzz/projects/turbogears }}} It complains of the database not being configured. I am able to import formmodel without any problem from a python prompt_ so it's not just an import that causes a problem. It seems like Nose is actually trying to run something in there.,1143081305,1143047147,kevin
diff --git a/tickets.rss b/tickets.rss
new file mode 100644
index 0000000..a5dca30
--- /dev/null
+++ b/tickets.rss
@@ -0,0 +1,7578 @@
+<?xml version="1.0"?>
+<!-- RSS generated by Trac v0.8 on Tue Dec 19 10:16:42 2006 -->
+<rss version="2.0">
+
+
+ <channel>
+
+ <title>nose: {6} All Tickets By Milestone (Including closed)</title>
+
+
+ <link>http://nose.python-hosting.com/report/6</link>
+ <description>Trac Report - {6} All Tickets By Milestone (Including closed)</description>
+ <language>en-us</language>
+ <generator>Trac v0.8</generator>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 13 Sep 2006 17:31:09 GMT</pubDate>
+ <title>#90: Improve logging config options</title>
+ <link>http://nose.python-hosting.com/ticket/90</link>
+ <description>Logging (for nose itself and the packages it tests) config should be more accessible -- esp. it should be possible to configure logging with a standard logging config file. Attachment is a plugin from Oliver Rutherfurd that adds --log-config and --log-filename options. This should be adapted and made part of configure_logging in nose.core.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 28 Aug 2006 19:34:53 GMT</pubDate>
+ <title>#85: Is it possible to have more control over TestProgram configuration when running the nose from within python code?</title>
+ <link>http://nose.python-hosting.com/ticket/85</link>
+ <description>I am trying to use nose with the NoseXML plugin. When I call:
+
+ nose.run(argv=['--with-nosexml','--xml-report-file=some_file']),
+
+I get my NoseXML output in some_file. This is nice.
+
+On the other hand, it would be nicer if I could specify a StringIO that the NoseXML could write to instead of a file in the filesystem.
+
+I have managed to do this by poking around inside the nose.core.TestProgram class and nose.core.configure function, but my solution is not really acceptable for long-term use. I manually insert a StringIO into the configuration information after argv is parsed and before it is passed to the plugins.
+
+Please consider providing a different means for specifying configuration information to nose when it is run using nose.run(). I would be glad to help with this if it would be an acceptable change.
+
+And if I've missed the proper way to do something like this, please let me know.
+
+Thanks,
+Matthew Desmarais</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 14 May 2006 18:06:41 GMT</pubDate>
+ <title>#57: .noserc</title>
+ <link>http://nose.python-hosting.com/ticket/57</link>
+ <description>Support reading options from a .noserc file or other config file. Format should be the same as command line args (long form), minus the --.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 05 Aug 2006 01:49:32 GMT</pubDate>
+ <title>#80: provide TestCase methods as functions.</title>
+ <link>http://nose.python-hosting.com/ticket/80</link>
+ <description>Hi
+
+First of all I'm new to nose and I like what I see, I always complained about JUnit/pyUnit because it's too much troubles ... nose takes that away from me.
+
+but when I try to test for a method that should raises a certain type of exception I found out that the only way to do this is with TestCase, at least to catch a certain specific type of test.
+
+So how abotu adding a reimplementation (basically transform the methods into functions of TestCase.* into module level nose functions?
+
+So we can implement this
+{{{
+class TestMyApp(TestCase):
+ def test_create(self):
+ self.failUnlessRaises(NotImplementedError, source.create)
+}}}
+
+as
+
+{{{
+def test_create():
+ nose.failUnlessRaises(NotImplementedError, source.create)
+}}}
+
+here is the original thread. http://tinyurl.com/mvssg</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 24 Mar 2006 03:12:25 GMT</pubDate>
+ <title>#24: Allow plugins to completely change test output</title>
+ <link>http://nose.python-hosting.com/ticket/24</link>
+ <description>Currently watcher plugins can report() to add to test output, but there should be a hook for plugins to take over and do all test output.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 28 Mar 2006 04:24:26 GMT</pubDate>
+ <title>#27: Missing units</title>
+ <link>http://nose.python-hosting.com/ticket/27</link>
+ <description>Missing unittests for many core functions:
+ * loader testsInModule
+ * loader FunctionTestCase
+ * loader MethodTestCase
+ * LazySuite.run</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 23 May 2006 02:28:04 GMT</pubDate>
+ <title>#61: Attribute plugin 'OR' test doesn't work</title>
+ <link>http://nose.python-hosting.com/ticket/61</link>
+ <description>nosetests -a tags=a -a tags=b should select tests that have a tags attribute with the value of 'a' or 'b' or a list containing one or both of those values, but it doesn't.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 17 May 2006 20:32:25 GMT</pubDate>
+ <title>#59: nose.tools.raises hides module of original test</title>
+ <link>http://nose.python-hosting.com/ticket/59</link>
+ <description>When using nose.tools.raises, the test reports look like:
+
+{{{
+nose.tools.&lt;testfunc&gt;
+}}}
+
+Instead of:
+
+{{{
+&lt;testmod&gt;.&lt;testfunc&gt;
+}}}
+
+raises needs to set the name or module of the wrapper it returns properly.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 17 May 2006 15:17:06 GMT</pubDate>
+ <title>#58: ArrtibuteError running nosetests</title>
+ <link>http://nose.python-hosting.com/ticket/58</link>
+ <description>I'm getting this when running nosetests. Not sure whats causing it, but I thought someone might be able to point me in the right direction.
+
+I will attach the traceback.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 03 May 2006 02:20:44 GMT</pubDate>
+ <title>#54: ignore all executable files?</title>
+ <link>http://nose.python-hosting.com/ticket/54</link>
+ <description> * Is this desirable? (YES)
+ * Is it possible to do, dependably, cross-platform? (YES)</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 01 May 2006 15:50:59 GMT</pubDate>
+ <title>#51: nose.collector causes loop when running `setup.py test`</title>
+ <link>http://nose.python-hosting.com/ticket/51</link>
+ <description>have a looksee here at my setup.py file:
+svn co http://svn.testtools.python-hosting.com/trunk --revision=186 testtools
+
+I'm using test_suite = &#34;nose.collector&#34; and when I run `setup.py test` with 0.9a1 it gets caught in a loop like so :
+
+running test
+running egg_info
+writing testtools.egg-info/PKG-INFO
+writing top-level names to testtools.egg-info/top_level.txt
+writing manifest file 'testtools.egg-info/SOURCES.txt'
+running build_ext
+At revision 186.
+running test
+running egg_info
+writing testtools.egg-info/PKG-INFO
+writing top-level names to testtools.egg-info/top_level.txt
+writing manifest file 'testtools.egg-info/SOURCES.txt'
+running build_ext
+At revision 186.
+
+... but when I run `nosetests` everything goes smooth. I mentioned in the email that it was working on dev2, but I meant it was working for other projects. I.E. running `python setup.py test` in etl/trunk/py-lib/ works just fine. I can't see offhand what is different.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 01 May 2006 18:21:39 GMT</pubDate>
+ <title>#53: plugin import errors kill test run</title>
+ <link>http://nose.python-hosting.com/ticket/53</link>
+ <description>Plugin import errors need to be reduced to warnings, since the import happens before users have a chance to disable the plugin.
+
+Example: If profile module is not installed, nosetests exits with exception without running any tests.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 01 May 2006 18:18:29 GMT</pubDate>
+ <title>#52: profile plugin shadows builtin profile module</title>
+ <link>http://nose.python-hosting.com/ticket/52</link>
+ <description>It needs a name change, causes nosetests to fail to load on some platforms.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 05 May 2006 15:32:13 GMT</pubDate>
+ <title>#56: wantFunction and wantMethod bugs in attr [patch]</title>
+ <link>http://nose.python-hosting.com/ticket/56</link>
+ <description>this might be better fixed in the loader since I think at least for the wantMethod bug, it should not get something that's not a method. But this patches was necessary to allow a large ETL suite to run that I'm trying to use attributes in. a patch against branches/0.9-stable is to follow</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 03 May 2006 15:18:43 GMT</pubDate>
+ <title>#55: bug in doctest plugin loadTestsFromPath [patch]</title>
+ <link>http://nose.python-hosting.com/ticket/55</link>
+ <description>we get an iteration error in the doctest plugin when looking at a directory filename (i.e. not a valid .py file). A patch is to follow ...</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 24 Apr 2006 00:30:10 GMT</pubDate>
+ <title>#50: Update mkrelease</title>
+ <link>http://nose.python-hosting.com/ticket/50</link>
+ <description>Update mkrelease to make svn/svk branch and tag instead of bzr.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 09 Mar 2006 02:51:18 GMT</pubDate>
+ <title>#4: doc -&amp;gt; wiki</title>
+ <link>http://nose.python-hosting.com/ticket/4</link>
+ <description>Add a script similiar to mkindex.py that posts doc updates to the right places in this wiki.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 23 Apr 2006 23:57:41 GMT</pubDate>
+ <title>#49: Update docs for 0.9</title>
+ <link>http://nose.python-hosting.com/ticket/49</link>
+ <description> * Update the CHANGELOG and NEWS files.
+ * Update module, package and class docstrings
+ * Update TestProgram usage
+ * Update mkindex, make sure it is pulling all relevant info
+ * Update hacking, etc, on index to include new svn repos information
+ * Add to this ticket as I think of more doc updates that are needed</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 11 Apr 2006 02:53:09 GMT</pubDate>
+ <title>#37: setuptools integration phase 2: disable plugins</title>
+ <link>http://nose.python-hosting.com/ticket/37</link>
+ <description>When run under setuptools, should disable plugins that implement methods that won't get a chance to run (report, finalize, prepareTest, setOutputStream).</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 22 Apr 2006 01:02:16 GMT</pubDate>
+ <title>#48: logging behavior: ignore root logger settings</title>
+ <link>http://nose.python-hosting.com/ticket/48</link>
+ <description>Since nose is likely to be run in unstable environments where users are setting their root or other loggers to debug to debug their own code, and those users are probably not interested in nose's debug info, nose should explicitly override the root logger settings in the 'nose' domain. Don't use basicConfig, but compose a handler and formatter and set the log level to whatever is appropriate for the selected verbosity level.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 18 Apr 2006 15:00:45 GMT</pubDate>
+ <title>#46: super?</title>
+ <link>http://nose.python-hosting.com/ticket/46</link>
+ <description>Check usage of super() vs direct __init__ calls. Ref: http://fuhm.net/super-harmful/</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 18 Apr 2006 03:09:26 GMT</pubDate>
+ <title>#44: disable attrib plugin eval option for versions &amp;lt; 2.4</title>
+ <link>http://nose.python-hosting.com/ticket/44</link>
+ <description>eval() can't take an instance in 2.3, so the attrib eval() option must be disabled in 2.3.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 18 Apr 2006 03:15:34 GMT</pubDate>
+ <title>#45: Fix tests for 2.3</title>
+ <link>http://nose.python-hosting.com/ticket/45</link>
+ <description>Many tests are failing under 2.3 due to incompatibile iteration, etc.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 16 Apr 2006 04:15:13 GMT</pubDate>
+ <title>#43: nosetests bad_file.py -&amp;gt; greedy loads</title>
+ <link>http://nose.python-hosting.com/ticket/43</link>
+ <description>When given a bad file name, nosetests loads tests from all modules instead of issuing a warning.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 16 Apr 2006 04:13:25 GMT</pubDate>
+ <title>#42: nosetests relative/path.py -&amp;gt; no tests loaded</title>
+ <link>http://nose.python-hosting.com/ticket/42</link>
+ <description>Test name resolution for relative filenames is wrong. The files are not loaded.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 16 Apr 2006 04:09:49 GMT</pubDate>
+ <title>#41: profiler plugin is broken</title>
+ <link>http://nose.python-hosting.com/ticket/41</link>
+ <description>Trying to run with profiler enabled results in errors from the hotshot stats loader:
+
+{{{
+Could not identify fileId 10
+Could not identify fileId 10
+Traceback (most recent call last):
+ File &#34;&lt;stdin&gt;&#34;, line 1, in ?
+ File &#34;/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/hotshot/stats.py&#34;, line 12, in load
+ return StatsLoader(filename).load()
+ File &#34;/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/hotshot/stats.py&#34;, line 29, in load
+ for event in log:
+ File &#34;/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/hotshot/log.py&#34;, line 120, in next
+ filename = self._filemap[fileno]
+KeyError: 91
+}}}</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 13 Apr 2006 14:08:57 GMT</pubDate>
+ <title>#40: stop on first error</title>
+ <link>http://nose.python-hosting.com/ticket/40</link>
+ <description>Suggestion from Kevin Dangoor:
+
+Add an option to stop running tests on the first failure.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 09 Apr 2006 00:49:00 GMT</pubDate>
+ <title>#36: loader.loadTestsFromNames behavior</title>
+ <link>http://nose.python-hosting.com/ticket/36</link>
+ <description>The test loader's loadTestsFromNames behavior isn't compatible with single-test-file unittest-style command lines, eg:
+
+{{{
+python unit_tests/test_loader.py TestNoseTestLoader.test_generate_func
+}}}
+
+It needs to be revised for compatibility with unittest.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 07 Apr 2006 02:38:41 GMT</pubDate>
+ <title>#34: nose.main signature does not match unittest.main</title>
+ <link>http://nose.python-hosting.com/ticket/34</link>
+ <description>nose.main should be usable interchangably with unittest.main.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 03 Apr 2006 03:34:40 GMT</pubDate>
+ <title>#33: coverage plugin: option to erase before run</title>
+ <link>http://nose.python-hosting.com/ticket/33</link>
+ <description>The coverage plugin should have an option to allow the user to erase accumulated stats before a test run.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 01 Apr 2006 04:37:47 GMT</pubDate>
+ <title>#32: revise setuptools support, phase 1</title>
+ <link>http://nose.python-hosting.com/ticket/32</link>
+ <description>To support setuptools test command as best as possible without monkeypatching, follow PJE's prescription:
+
+{{{
+#!python
+ class ResultProxy:
+ def addError(self, test, err):
+ # reformat err, adding captured info
+ # then calling addError() on the wrapped result
+
+ def startTest(self, test):
+ # code to begin output capture and assertion tracking
+ # then call startTest() on the wrapped result
+
+ def stopTest(self, test):
+ # code to end output capture and assertion tracking
+ # then call stopTest() on the wrapped result
+
+ # ... etc.
+
+
+ class TestProxy:
+ def __call__(self, result):
+ self.wrapped_test(ResultProxy(result))
+
+ def shortDescription(self):
+ return self.wrapped_test.shortDescription()
+}}}
+
+The test_suite hook is still better than the test_loader hook, since test suite can be a function that does other setup; it should configure the system with a setting that deactivates any plugins that can't be supported under this scenario (that is, any plugin that uses report, finalize, prepareTest or setOutputStream)</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 31 Mar 2006 14:56:39 GMT</pubDate>
+ <title>#31: nose.tools</title>
+ <link>http://nose.python-hosting.com/ticket/31</link>
+ <description>Create nose.tools module and move with_setup there. Also add:
+ * @raises
+ * @timed
+
+And try to think of some more useful, general test-writing tools to add.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 18 Mar 2006 17:28:15 GMT</pubDate>
+ <title>#14: test generators for methods do not work</title>
+ <link>http://nose.python-hosting.com/ticket/14</link>
+ <description>Given the following testclass:
+
+class TestSomething(object):
+ def setUp(cls):
+ cls.x = 5
+ print &#34;setting up&#34;
+
+ def test_1(self):
+ assert self.x == 4
+
+ def test_2(self):
+ assert self.x == 6
+
+ def test_3(self):
+ for x in (1,2,7):
+ yield self.check,x
+
+ def check(self,arg):
+ assert arg %7 ==0
+
+
+Method test_3 does not function as a proper test generator. What should probably happen is:
+
+1) test_3 generates three separate tests, just like regular test generators
+2) Each of the three tests created by test_3 should get setUp() called when they're called.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 24 Mar 2006 03:22:51 GMT</pubDate>
+ <title>#25: profiler: output controls</title>
+ <link>http://nose.python-hosting.com/ticket/25</link>
+ <description>Need controls and options for those controls for the profiler plugin. Including:
+
+ * formatting options -- sort, restrict func names, % of list
+ * prof data filename option (file to store profile data in during run)
+ * print/no print report
+ * print to report stream
+ * output to file
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 11 Mar 2006 15:26:46 GMT</pubDate>
+ <title>#10: document plugin interfaces</title>
+ <link>http://nose.python-hosting.com/ticket/10</link>
+ <description>Document the collector, selector and watcher methods that plugins can implement and where they are called in the process.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 24 Mar 2006 01:02:35 GMT</pubDate>
+ <title>#22: loading tests from classes: beware subclassing</title>
+ <link>http://nose.python-hosting.com/ticket/22</link>
+ <description>The following case will currently result in wrong behavior:
+
+{{{
+#!python
+
+class TestA:
+ def test_a(self):
+ pass
+
+class TestB(TestA):
+ def test_b(self):
+ pass
+}}}
+
+TestB will collect and run both test_a and test_b; it should only run test_a</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 09 Mar 2006 15:04:10 GMT</pubDate>
+ <title>#8: warn on missed test names</title>
+ <link>http://nose.python-hosting.com/ticket/8</link>
+ <description>When called with test names on the command line, eg:
+
+{{{
+nosetests foo.bar.test
+}}}
+
+nose should track what tests it finds and runs, and warn at the end if a specified test name was not found. Not sure where to do the tracking.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 28 Mar 2006 05:05:47 GMT</pubDate>
+ <title>#30: pass captured output to plugins</title>
+ <link>http://nose.python-hosting.com/ticket/30</link>
+ <description>In addError and addFailure, pass captured output (if any) to plugin calls.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 28 Mar 2006 04:31:19 GMT</pubDate>
+ <title>#29: _import failure</title>
+ <link>http://nose.python-hosting.com/ticket/29</link>
+ <description>This import shouldn't be failing in selftest:
+
+{{{
+======================================================================
+ERROR: test module stpackage.subpak.other.tests in /Users/jhp/projects/nose_work_0.9/st
+----------------------------------------------------------------------
+Traceback (most recent call last):
+ File &#34;/Users/jhp/projects/nose_work_0.9/nose/suite.py&#34;, line 35, in run
+ self.setUp()
+ File &#34;/Users/jhp/projects/nose_work_0.9/nose/suite.py&#34;, line 128, in setUp
+ self.module = _import(self.moduleName, [self.path], self.conf)
+ File &#34;/Users/jhp/projects/nose_work_0.9/nose/importer.py&#34;, line 63, in _import fh, filename, desc = find_module(part, path)
+ImportError: No module named tests
+}}}</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 22 Mar 2006 15:34:34 GMT</pubDate>
+ <title>#19: watcher plugin API: access to test results</title>
+ <link>http://nose.python-hosting.com/ticket/19</link>
+ <description>make it easier for watcher plugins to access test results... possibly call addError, etc, in plugins from TextTestResult.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 18 Mar 2006 23:09:08 GMT</pubDate>
+ <title>#16: unit tests for plugin option handling</title>
+ <link>http://nose.python-hosting.com/ticket/16</link>
+ <description>See #15 for an example of why these are needed. All builtin plugins and builtin options/config need unit tests to ensure that they function as advertised</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 25 Mar 2006 04:43:26 GMT</pubDate>
+ <title>#26: func_names -&amp;gt; funcNames</title>
+ <link>http://nose.python-hosting.com/ticket/26</link>
+ <description>Much as I hate camelCase, unittest uses it and some overridden methods must use it, so for consistency, everythingShouldLookLikeThis.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 24 Mar 2006 01:11:37 GMT</pubDate>
+ <title>#23: refactor: revise for better unittest compatibility</title>
+ <link>http://nose.python-hosting.com/ticket/23</link>
+ <description>Refactor implemenation for a better fit with the slots provided.
+
+Ideas:
+ * LazySuite replaces collector
+ * Move loading from TestCollector, TestModule, etc into loader
+ * Loader gets selector
+ * Loader instantiates LazySuites and passes itself to them
+
+Add more details to this ticket.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 22 Mar 2006 15:12:33 GMT</pubDate>
+ <title>#18: setUpModule doesn't work</title>
+ <link>http://nose.python-hosting.com/ticket/18</link>
+ <description>In the documentation, it says you can use 'setUpModule' as the setup function for a module. In the code though, it actually uses 'setupModule' (note the different case on the 'u')</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 09 Mar 2006 02:46:26 GMT</pubDate>
+ <title>#2: implement profiler plugin</title>
+ <link>http://nose.python-hosting.com/ticket/2</link>
+ <description>Plugin should be a Watcher that outputs a profiler report after test run. Possibly exclude test packages from report, have a --profile-package argument (like coverage plugin).</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 20 Mar 2006 21:18:57 GMT</pubDate>
+ <title>#17: improve library discovery</title>
+ <link>http://nose.python-hosting.com/ticket/17</link>
+ <description>nosetests deals badly with a common package layout:
+{{{
+pack
+ lib
+ foo.py
+ test
+ test_foo.py
+}}}
+
+To be friendlier to that layout, selector should be updated to want directories that look like common source directories (lib and src at least).
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 09 Mar 2006 03:04:38 GMT</pubDate>
+ <title>#5: 'EOF in multiline input'</title>
+ <link>http://nose.python-hosting.com/ticket/5</link>
+ <description>Assert introspection fails for many expressions with an error like 'EOF in multiline input'</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 18 Mar 2006 23:07:30 GMT</pubDate>
+ <title>#15: attrib plugin env defaults should not be strings</title>
+ <link>http://nose.python-hosting.com/ticket/15</link>
+ <description>The attrib plugin is currently broken because the option defaults are strings, but the option type is append.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 11 Mar 2006 15:24:14 GMT</pubDate>
+ <title>#9: use logging for messaging</title>
+ <link>http://nose.python-hosting.com/ticket/9</link>
+ <description>This will be a 2-step process:
+
+ 1. replace nose.util.msg() with real logging, using the builting logging module.
+ 2. provide an interface for selecting which loggers and levels to output and where </description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 09 Mar 2006 03:30:53 GMT</pubDate>
+ <title>#7: add option to activate pdb on error/fail</title>
+ <link>http://nose.python-hosting.com/ticket/7</link>
+ <description>Add command line option/env var to activate the pdb on error/fail feature.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 09 Mar 2006 03:05:41 GMT</pubDate>
+ <title>#6: patch AssertionError only</title>
+ <link>http://nose.python-hosting.com/ticket/6</link>
+ <description>Install the patch that introspects assets as AssertionError only, instead of patching builtin.Exception.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 12 Mar 2006 20:01:49 GMT</pubDate>
+ <title>#12: patch: attribute-based test case selector</title>
+ <link>http://nose.python-hosting.com/ticket/12</link>
+ <description>This patch adds selecting test cases based on their attributes.
+
+Examples of test function/method attribute usage with patched nose
+
+Simple syntax (-a, --attr) examples:
+ * nosetests -a status=stable
+ =&gt; only test cases with attribute &#34;status&#34; having value &#34;stable&#34;
+
+ * nosetests -a priority=2,status=stable
+ =&gt; both attributes must match
+
+ * nosetests -a tags=http
+ =&gt; attribute list &#34;tags&#34; must contain value &#34;http&#34; (see test_foobar() below for definition)
+
+ * nosetests -a slow
+ =&gt; attribute &#34;slow&#34; must be defined and its value cannot equal to False (False, [], &#34;&#34;, etc...)
+
+ * nosetests -a !slow
+ =&gt; attribute &#34;slow&#34; must NOT be defined or its value must be equal to False
+
+Eval expression syntax (-A, --eval-attr) examples:
+ * nosetests -A &#34;not slow&#34;
+ * nosetests -A &#34;(priority &gt; 5) and not slow&#34;
+
+This example and the accompanied patch is in public domain, free for any use.
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 12 Mar 2006 11:22:20 GMT</pubDate>
+ <title>#11: patch: Windows path handling issues</title>
+ <link>http://nose.python-hosting.com/ticket/11</link>
+ <description>Nose 0.9 r5 fails to run any test cases on Windows. Here's a patch with fixes to some path handling issues.
+
+ - Mika
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 09 Mar 2006 02:49:15 GMT</pubDate>
+ <title>#3: use clean config in units</title>
+ <link>http://nose.python-hosting.com/ticket/3</link>
+ <description>In the unittests in selftest, each class or instance that can take a config argument should get a fresh _Config(), so that the configuration of the driving test runner doesn't leak into the test cases.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 12 Dec 2006 01:15:15 GMT</pubDate>
+ <title>#113: python setup.py nosetests --stop was raise TypeError</title>
+ <link>http://nose.python-hosting.com/ticket/113</link>
+ <description>I'm not sure if this would be true across all extra options sent to setup.py nosetests, however the fix seemed simple enough (the internals needed to handle integer values). A rough patch is following (this got it working).
+
+All this, using nose revision 143 and setuptools 0.6c3</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 02 Dec 2006 17:31:53 GMT</pubDate>
+ <title>#110: isolation plugin</title>
+ <link>http://nose.python-hosting.com/ticket/110</link>
+ <description>Include a plugin in core that resets the state of sys.modules between after each test module is run.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 01 Dec 2006 20:02:22 GMT</pubDate>
+ <title>#109: doctest vs coverage</title>
+ <link>http://nose.python-hosting.com/ticket/109</link>
+ <description>doctest requires a patch (or monkeypatch) to work correctly with the coverage module.
+
+ref:
+
+http://www.nedbatchelder.com/code/modules/coverage.html
+
+http://svn.zope.org/Zope3/trunk/src/zope/testing/doctest.py?rev=28679&amp;r1=28703&amp;r2=28705
+
+Since nose can't patch a user's doctest directly, we'll have to monkeypatch in a revise _OutputRedirectingPdb.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 22 Nov 2006 15:30:56 GMT</pubDate>
+ <title>#108: Generate and post plugin docs</title>
+ <link>http://nose.python-hosting.com/ticket/108</link>
+ <description>Generate HTML docs for built-in plugins and post them to the site and wiki.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 21 Nov 2006 15:48:27 GMT</pubDate>
+ <title>#106: Revise long description in setup.py</title>
+ <link>http://nose.python-hosting.com/ticket/106</link>
+ <description>Revise the long description in setup.py to be more accurate and descriptive.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 28 Oct 2006 22:06:05 GMT</pubDate>
+ <title>#100: nosetests man page</title>
+ <link>http://nose.python-hosting.com/ticket/100</link>
+ <description>Install a man page for nosetests on install. A man page contributed by Gustavo Noronha Silva is attached to this ticket.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 11 Dec 2006 16:46:06 GMT</pubDate>
+ <title>#112: test can't be run from package directory -- misleading INFO message</title>
+ <link>http://nose.python-hosting.com/ticket/112</link>
+ <description>I have a small module, i.e. a dir (say, package/) which has an __init__.py, a foo.py and a test_foo.py
+test_foo.py has the line 'import foo' in it, as it contains the test code for the code in foo.py
+
+I try to run the tests by running 'nosetests -vv' in the dir. I see the line
+&#34;nose.core: INFO: Working directory is a package; adding to sys.path&#34;
+appear, but the tests won't run, I get an
+ImportError: No module named foo
+
+The problem is that the message &#34;Working directory is a package; adding to sys.path&#34; is misleading. I doesn't add the current directory, it adds the _parent_ of the current directory to sys.path. (Due to the way add_path() is implemented in sys.path)
+
+I'm not sure how to characterise this problem. Simply having 'import package.foo' instead of 'import foo' in test_foo.py makes it work. Is there any reason to prohibit using 'import foo' in this case? Or maybe using add_path() for adding the current working directory is a bug?
+
+
+
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 05 Nov 2006 23:26:24 GMT</pubDate>
+ <title>#102: Nose frontpage installation instructions in error</title>
+ <link>http://nose.python-hosting.com/ticket/102</link>
+ <description>These instructions are wrong:
+{{{
+Install nose using setuptools:
+
+easy_install nose
+
+Or, if you don't have setuptools installed, use the download link
+at right to download the source package, and install in the normal
+fashion: Ungzip and untar the source package, cd to the new
+directory, and:
+
+python setup.py install
+}}}
+
+You cannot run python setup.py install without setup_tools upgraded to at least the version that nose is configured to work with, as per this error message:
+
+{{{
+$ sudo python setup.py install ~/src/nose-0.9.1
+The required version of setuptools (&gt;=0.6c2) is not available, and
+can't be installed while this script is running. Please install
+ a more recent version first.
+
+(Currently using setuptools 0.6c1 (/usr/lib/python2.4/site-packages/setuptools-0.6c1-py2.4.egg))
+zsh: 32149 exit 2 sudo python setup.py install
+}}}
+
+I recommend ammending the instructions to say
+{{{
+python ez_setup.py
+python setup.py install
+}}}
+and note that the installation will cause easy_install to be installed. Perhaps a link to ez_setup.py would be good too.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 04 Oct 2006 21:21:27 GMT</pubDate>
+ <title>#95: evaluating asserts stops working when there is a two-line docstring</title>
+ <link>http://nose.python-hosting.com/ticket/95</link>
+ <description>This is a problem with nose version 0.9.0.
+
+When I run the following test with nosetests -d option,
+
+def test_integers():
+ a = 2
+ assert a == 4
+
+I get this expected result, the variable a is expanded:
+
+ ...
+ assert a == 4
+AssertionError
+ 2 = 2
+&gt;&gt; assert 2 == 4
+
+However, when I add a two-line docstring like that:
+
+def test_integers():
+ &#34;&#34;&#34;docstring line 1
+ docstring line 2
+ &#34;&#34;&#34;
+ a = 2
+ assert a == 4
+
+then, instead of the variable expansion,
+the last line of the docstring is displayed:
+
+ ...
+ assert a == 4
+AssertionError
+ docstring line 2</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 01 Nov 2006 21:02:07 GMT</pubDate>
+ <title>#101: Doesn't select decorated methods/functions</title>
+ <link>http://nose.python-hosting.com/ticket/101</link>
+ <description>If a function has a decoration nose will not pick it up for testing, it is of type 'function proxy' instead of 'function'.
+
+This was tested on Debian testing with version 0.9.0-1
+
+Test case:
+{{{
+def my_decor(func):
+ return lambda: func()
+
+def test_decor():
+ assert False
+
+@my_decor
+def test_decor1():
+ assert False
+}}}
+
+In the above test case we have two functions, one decorated and one not. Running it through nosetests shows only one detected function which fails while we expect two functions failing.
+
+Running it in verbose mode will show that test_decor1 is not picked up for testing.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 05 Dec 2006 18:35:32 GMT</pubDate>
+ <title>#111: nosetests -vvvv produces little output</title>
+ <link>http://nose.python-hosting.com/ticket/111</link>
+ <description>You get more output with -v, -vv, and -vvv -- but with -vvvv the output goes away</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 16 Nov 2006 20:59:35 GMT</pubDate>
+ <title>#105: nose 0.9.1 does not run functional tests in order of appearance in the module</title>
+ <link>http://nose.python-hosting.com/ticket/105</link>
+ <description>In nose main page, http://somethingaboutorange.com/mrl/projects/nose/,
+the section titled **Writing tests** says:
+
+[quote]
+
+Like py.test, functional tests will be run in the order in which they
+appear in the module file. TestCase derived tests and other test
+classes are run in alphabetical order.
+
+[endquote]
+
+
+nose 0.9.1 does not seem to do this at all. It seems that it performs
+the tests in the following order:
+
+- run test functions that are defined with the raises decorator
+- runs the other test functions in alphabetical order of the test
+function names
+
+py.test does run the test functions in order of appearance in the
+module and I'd like to be able to depend on that when using nose.
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 01 Aug 2006 23:48:00 GMT</pubDate>
+ <title>#79: ability to change the regex pattern </title>
+ <link>http://nose.python-hosting.com/ticket/79</link>
+ <description>hello, i just started using nose and i've read the help but can't find a setting to customize the discovery regex. was hoping it would discover tests named with our standard naming system: something like 'modulename_unittest.py'. could this functionality be added?</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 22 Nov 2006 15:18:08 GMT</pubDate>
+ <title>#107: Expose the guts of @raises as assert_raises</title>
+ <link>http://nose.python-hosting.com/ticket/107</link>
+ <description>@raises is useful for some users, but others want to be able to stack up several raises tests inside of one test case, so it would be helpful to have an assert_raises that they can call directly.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 13 Apr 2006 14:07:55 GMT</pubDate>
+ <title>#39: setuptools integration: pick up options from setup.cfg</title>
+ <link>http://nose.python-hosting.com/ticket/39</link>
+ <description>Suggestion from Kevin Dangoor:
+
+{{{
+Even if hooking into setuptools' test command doesn't work,
+would it be possible for you to make a distutils command wrapper
+(setuptools allows you to easily plug in new commands). The reason I
+say this is that nosetests has a growing set of options, and it would
+be nice to be able to specify the right set of options in setup.cfg.
+}}}
+
+First need to figure out what this will require and from that decide the appropriate milestone.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 11 Apr 2006 02:54:05 GMT</pubDate>
+ <title>#38: setuptools integration phase 3: custom command</title>
+ <link>http://nose.python-hosting.com/ticket/38</link>
+ <description>Create a setuptools command that exposes the full functionality of nose and all plugins.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 25 Oct 2006 17:46:42 GMT</pubDate>
+ <title>#99: integrated twisted with nose</title>
+ <link>http://nose.python-hosting.com/ticket/99</link>
+ <description>Here is the Twisted integration source code.
+
+twistedtools.py is the implementation itself (I first tried to call it &#34;twisted&#34;, but then it shadows the original twisted package). It allows to decorate tests that return a Deferred.
+
+test_twisted.py is the test suite for the implementation. There probably should be a way to skip it if Twisted is not installed (instead of raising ImportError all around), but I don't know the right way to do that.
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 25 Sep 2006 15:52:56 GMT</pubDate>
+ <title>#92: @with_setup doesn't mix well with @raises</title>
+ <link>http://nose.python-hosting.com/ticket/92</link>
+ <description>Hi,
+
+I tried to write the following code:
+
+@raises(NotEnoughBytes)
+@with_setup(setup1)
+def test32():
+ ...
+
+This failed in a strange way. It seems nose either called the wrong setup function (I have different setup functions for different tests), or didn't call one at all (I didn't investigate very far).
+The fix came by inverting the decorator order:
+
+@with_setup(setup1)
+@raises(NotEnoughBytes)
+def test32():
+ ...
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 12 Oct 2006 19:28:14 GMT</pubDate>
+ <title>#98: @with_setup not calling teardown() if test raises exception</title>
+ <link>http://nose.python-hosting.com/ticket/98</link>
+ <description>I'm not sure if this is desired behvior or not, but I noticed that if a test function decorated with @with_setup() raises an exception then the teardown() method is not called. My personal choice is that a teardown function is called in a finally block as the test is run, to *always* undo what was done by setup.
+
+I took a [very] quick stab at adding a test to nose's suite for this but couldn't come up with one since setup and teardown are just properties set on the test method. hmm. Was using revision 98.
+
+-Kumar McMillan</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 28 Sep 2006 02:33:39 GMT</pubDate>
+ <title>#94: --doctest-extension and NOSE_DOCTEST_EXTENSION conflict</title>
+ <link>http://nose.python-hosting.com/ticket/94</link>
+ <description>If you define both the environmental variable and give the command-line variable, you get:
+
+{{{
+Traceback (most recent call last):
+ File &#34;/usr/local/bin/nosetests&#34;, line 7, in ?
+ sys.exit(
+ File &#34;/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py&#34;, line 438, in main
+ return sys.exit(not run(*arg, **kw))
+ File &#34;/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py&#34;, line 446, in run
+ result = TestProgram(*arg, **kw).success
+ File &#34;/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py&#34;, line 199, in __init__
+ self.parseArgs(argv, env)
+ File &#34;/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py&#34;, line 206, in parseArgs
+ self.conf = configure(argv, env)
+ File &#34;/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/core.py&#34;, line 322, in configure
+ options, args = parser.parse_args(argv)
+ File &#34;/usr/lib/python2.4/optparse.py&#34;, line 1278, in parse_args
+ stop = self._process_args(largs, rargs, values)
+ File &#34;/usr/lib/python2.4/optparse.py&#34;, line 1318, in _process_args
+ self._process_long_opt(rargs, values)
+ File &#34;/usr/lib/python2.4/optparse.py&#34;, line 1393, in _process_long_opt
+ option.process(opt, value, values, self)
+ File &#34;/usr/lib/python2.4/optparse.py&#34;, line 710, in process
+ return self.take_action(
+ File &#34;/usr/lib/python2.4/optparse.py&#34;, line 723, in take_action
+ values.ensure_value(dest, []).append(value)
+AttributeError: 'str' object has no attribute 'append'
+}}}</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 28 Sep 2006 00:09:08 GMT</pubDate>
+ <title>#93: try:except: around inspect.getargspec</title>
+ <link>http://nose.python-hosting.com/ticket/93</link>
+ <description>I got this exception from the collector:
+
+{{{
+ File &#34;/usr/local/lib/python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/util.py&#34;, line 163, in try_run
+ args, varargs, varkw, defaults = inspect.getargspec(func)
+ File &#34;/usr/lib/python2.4/inspect.py&#34;, line 670, in getargspec
+ raise TypeError('arg is not a Python function')
+}}}
+
+nose should catch this and tell more about what &#34;func&#34; really is.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 04 Oct 2006 22:20:30 GMT</pubDate>
+ <title>#96: Names of modules in test packages </title>
+ <link>http://nose.python-hosting.com/ticket/96</link>
+ <description>Test packages are not documented very well. It seems all modules living in a test package are automatically considered test modules, irrespective whether their names match the testMatch regular expression or not. Is this by design? At least it should be documented.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 19 Sep 2006 17:24:17 GMT</pubDate>
+ <title>#91: python 2.5: assert introspection: different line counts</title>
+ <link>http://nose.python-hosting.com/ticket/91</link>
+ <description>In python 2.5, some assert introspection tests fail because the traceback source analyzer comes back with different line numbers sometimes than it does in 2.4.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 21 Jul 2006 16:00:36 GMT</pubDate>
+ <title>#76: No handlers for logger spam</title>
+ <link>http://nose.python-hosting.com/ticket/76</link>
+ <description>No handlers could be found for logger &#34;nose.plugins&#34; is spammed to the console sometimes(?) on startup.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 31 Aug 2006 14:08:54 GMT</pubDate>
+ <title>#86: python version detection broken for 3.0 and above</title>
+ <link>http://nose.python-hosting.com/ticket/86</link>
+ <description>From Kevin Dangoor:
+
+{{{
+in nose/plugins/attrib.py:
+
+compat_24 = pyvrs[0] &gt;= 2 and pyvrs[1] &gt;= 4
+
+would fail with Python 3.0 (though all bets are off for compatibility
+there anyhow :)
+
+Python version detection actually had a discussion on the tg list a
+few months back.
+
+you can rewrite this:
+compat_24 = sys.version_info &gt;= (2, 4)
+}}}</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 08 Aug 2006 14:22:55 GMT</pubDate>
+ <title>#81: /lib -style package organization broken</title>
+ <link>http://nose.python-hosting.com/ticket/81</link>
+ <description>When a package is organized like:
+
+{{{
+ /lib
+ module.py
+ /tests
+ test_module.py
+}}}
+
+nose loads test_module but even though it has already seen lib, it has failed to put it on sys.path, unless a plugin has asked to load all modules.
+
+Possible solution: when addPaths is on, always add the surrounding directory of any .py file we see.
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 24 Aug 2006 21:51:17 GMT</pubDate>
+ <title>#83: -x/--stop stops on skipped tests</title>
+ <link>http://nose.python-hosting.com/ticket/83</link>
+ <description>the -x/--stop option will stop on a skipped test even though that's not really an error. I haven't tested the others like deprecated tests. Tested w/ version 0.9.0 only.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 21 Jul 2006 15:58:16 GMT</pubDate>
+ <title>#75: Multiple --include arguments should 'OR' not override</title>
+ <link>http://nose.python-hosting.com/ticket/75</link>
+ <description>Multiple --include arguments should result in everything that matches any of them being included, instead of the current behavior, which is that only the last --include issued is used.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sat, 29 Jul 2006 15:08:58 GMT</pubDate>
+ <title>#78: option for coverage to include all .py files</title>
+ <link>http://nose.python-hosting.com/ticket/78</link>
+ <description>Coverage reported by the coverage plugin can be misleading. Files not imported by the test suite will not be reported, thereby making the coverage appear larger. This patch adds a --cover-inclusive option that will cause all .py files (matching --cover-package if existing) under the working directory to be included in the report.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 06 Jul 2006 16:36:31 GMT</pubDate>
+ <title>#72: package.mod:Class doesn't select all tests in class</title>
+ <link>http://nose.python-hosting.com/ticket/72</link>
+ <description>It looks like package.mod:Class is broken; it doesn't select all of the tests in the class -- it selects nothing.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 19 Jul 2006 19:50:46 GMT</pubDate>
+ <title>#74: Possible bug in subpackage_of</title>
+ <link>http://nose.python-hosting.com/ticket/74</link>
+ <description>I was using 0.9b2 earlier without problems, but after upgrade to 0.9 &#34;python setup.py test&#34; command doesn't work anymore. My directory structure is (full avaiable here: http://pycheesecake.org/browser/branches/mk):
+
+{{{
+cheesecake/
+...
+README
+setup.py
+tests/
+ unit/
+ functional/
+ data/
+}}}
+
+Running &#34;nosetests --with-doctest --doctest-tests --include unit --verbose&#34; runs all of the tests in &#34;tests/unit&#34; along with doctests found in package code. But using nose.collector by setup.py script runs only one doctest from the &#34;tests/unit/&#34; directory (so it omits all unit tests and doctests in project directory &#34;cheesecake/&#34;). Our setup.py config is avaiable here: http://pycheesecake.org/browser/branches/mk/setup.py .
+
+By browsing through the diff of 0.9b-&gt;0.9.0 I've found out that part of code that makes a difference is inside new subpackage_of() function. If you omit comparisons of &#34;mod_parts&#34; and &#34;pkg_parts&#34; (lines 369-379) nose.collector works just like in 0.9b running all of my unit and doc tests.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 17 May 2006 21:16:24 GMT</pubDate>
+ <title>#60: Add function that works like unittest.main(): collects tests in __main__ only</title>
+ <link>http://nose.python-hosting.com/ticket/60</link>
+ <description>Add a function to core that works like unittest.main, that is, collects test in main only. Usage would be like:
+
+{{{
+#!python
+import nose
+
+def test_a():
+ pass
+
+def test_b():
+ pass
+
+if __name__ == '__main__':
+ nose.runtests()
+}}}
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 25 May 2006 00:15:07 GMT</pubDate>
+ <title>#62: Allow multiple -w arguments</title>
+ <link>http://nose.python-hosting.com/ticket/62</link>
+ <description>nosetests should allow multiple -w arguments to include multiple test roots in one run.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 06 Jul 2006 22:10:49 GMT</pubDate>
+ <title>#73: nose.collector not finding all tests in `setup.py test`</title>
+ <link>http://nose.python-hosting.com/ticket/73</link>
+ <description>using nose-0.9.0-py2.4.egg ...
+I'm getting some strange behavior trying to run `python setup.py test`
+It only finds my doctests. However, if I run `nosetests -v --with-doctest --doctest-tests` all tests are found. In setup.py I am setting the env vars which would be the equivalent of the above command line options, i.e.
+
+{{{
+os.environ['NOSE_WITH_DOCTEST'] = '1'
+os.environ['NOSE_DOCTEST_TESTS'] = '1'
+}}}
+
+I will dig around the code a little more to see if I can figure out where it's going wrong, but wanted to submit this ticket in the meantime since you might know where to look in nose.collector
+
+here is how to reproduce :
+
+{{{
+svn co --revision 197 http://svn.testtools.python-hosting.com/trunk testtools
+cd testtools
+python setup.py test
+}}}
+
+and this is what I was expecting :
+
+{{{
+nosetests -v --with-doctest --doctest-tests
+}}}
+
+am I missing anything?</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 28 Jun 2006 12:55:39 GMT</pubDate>
+ <title>#71: nosetests -s results in IOError: [Errno 29] Illegal seek</title>
+ <link>http://nose.python-hosting.com/ticket/71</link>
+ <description>I do:
+
+{{{
+$ nosetests -s
+}}}
+
+and get:
+
+{{{
+Traceback (most recent call last):
+ File &#34;/usr/bin/nosetests&#34;, line 7, in ?
+ sys.exit(
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py&#34;, line 434, in main
+ return sys.exit(not run(*arg, **kw))
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py&#34;, line 442, in run
+ result = TestProgram(*arg, **kw).success
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py&#34;, line 201, in __init__
+ self.runTests()
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py&#34;, line 229, in runTests
+ result = self.testRunner.run(self.test)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/core.py&#34;, line 100, in run
+ result = unittest.TextTestRunner.run(self, test)
+ File &#34;/usr/lib/python2.4/unittest.py&#34;, line 696, in run
+ test(result)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 40, in __call__
+ self.run(*arg, **kw)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 54, in run
+ test(result)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 40, in __call__
+ self.run(*arg, **kw)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 54, in run
+ test(result)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 40, in __call__
+ self.run(*arg, **kw)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 54, in run
+ test(result)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 40, in __call__
+ self.run(*arg, **kw)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 54, in run
+ test(result)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 40, in __call__
+ self.run(*arg, **kw)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/suite.py&#34;, line 54, in run
+ test(result)
+ File &#34;/usr/lib/python2.4/unittest.py&#34;, line 281, in __call__
+ return self.run(*args, **kwds)
+ File &#34;/usr/lib/python2.4/unittest.py&#34;, line 276, in run
+ if ok: result.addSuccess(self)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/result.py&#34;, line 176, in addSuccess
+ Result.addSuccess(self, test)
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/result.py&#34;, line 83, in addSuccess
+ self.resetBuffer()
+ File &#34;/usr/lib/python2.4/site-packages/nose-0.9.1.dev_r63-py2.4.egg/nose/result.py&#34;, line 104, in resetBuffer
+ sys.stdout.truncate(0)
+IOError: [Errno 29] Illegal seek
+}}}
+
+using nose patch 68 from SVN under Ubuntu Dapper (6.06).
+
+Not sure why the egg is labeled dev_r63, but it's definiately patch 68.
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 23 Jun 2006 13:58:58 GMT</pubDate>
+ <title>#70: Missing file warning spam</title>
+ <link>http://nose.python-hosting.com/ticket/70</link>
+ <description>The missing file warning repeats once for every test file compared against a requested missing file. It would be better to output only once per run per missing file.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 12 Jun 2006 10:11:30 GMT</pubDate>
+ <title>#69: All python files are executable on windows</title>
+ <link>http://nose.python-hosting.com/ticket/69</link>
+ <description>On Windows (or at least my version of Windows XP) all newly created .py files are executable. That is, os.access(myFilePath, os.X_OK) returns True for all of my .py files.
+
+This means that the default behaviour of omitting executable files unless --exe is set causes doctests in non-test modules to not run on Windows. This happens because non-test modules get checked with wantFile() rather than wantModule() and get ignored becuase there are executable.
+
+This bug is hidden slightly at the moment because the sense of --exe is currently reversed - see #68. Currently the doctests are omitted when --exe is used. After #68 is fixed they will be omitted when --exe is ''not'' used.
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 23 Mar 2006 02:43:52 GMT</pubDate>
+ <title>#21: add unittests for lunatic objects</title>
+ <link>http://nose.python-hosting.com/ticket/21</link>
+ <description>Add unittests for weirdo calls that might come up, such as calling want_function() with something that doesn't have a {{{__name__}}}.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 09 Mar 2006 02:43:25 GMT</pubDate>
+ <title>#1: coverage output for single tests</title>
+ <link>http://nose.python-hosting.com/ticket/1</link>
+ <description>Ran:
+{{{
+python nose/core.py -vvvvv -w st/unit_tests --with-coverage --cover-package=nose test_selector
+}}}
+
+Expected: coverage output
+
+Actual: no coverage output</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 12 Jun 2006 09:40:57 GMT</pubDate>
+ <title>#68: The meaning of '--exe' is backwards</title>
+ <link>http://nose.python-hosting.com/ticket/68</link>
+ <description>the command line option '--exe' is documented as causing more files to be included. Therefore it should '''increase''' the number of tests run. In my tests adding this option actually decreases the number of tests run.
+
+{{{
+C:\data\code\aa\Newman\POS\gui&gt;python &#34;c:\Program Files\Python23\Scripts\nosetes
+ts-script.py&#34; -d --with-doctest --doctest-tests -v
+doctest of DialogExceptHook.DialogExceptHook ... ok
+
+----------------------------------------------------------------------
+Ran 1 test in 0.359s
+
+OK
+
+C:\data\code\aa\Newman\POS\gui&gt;python &#34;c:\Program Files\Python23\Scripts\nosetes
+ts-script.py&#34; -d --with-doctest --doctest-tests -v --exe
+
+----------------------------------------------------------------------
+Ran 0 tests in 0.015s
+
+OK
+}}}
+
+I think I've tracked this down to the following code starting on line 241 of source:branches/0.9-stable/nose/selector.py#40
+
+{{{
+#!python
+if not self.conf.ignoreExe and os.access(file, os.X_OK):
+ log.info('%s is executable; skipped', file)
+ return False
+}}}
+
+that 'not' looks like it should not be there.
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 08 Jun 2006 14:36:33 GMT</pubDate>
+ <title>#66: specifying test names causes repeat imports</title>
+ <link>http://nose.python-hosting.com/ticket/66</link>
+ <description>Specifying test names can change nose's behavior in extremely strange ways. For The attached test case, the following all produce different import behavior, in some cases resulting in repeat imports of modules in sys.modules:
+
+{{{
+nosetests -w zz
+nosetests
+nosetests test_model
+nosetests -w zz test_model
+}}}</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 30 May 2006 20:31:34 GMT</pubDate>
+ <title>#63: TypeError: iteration over non-sequence</title>
+ <link>http://nose.python-hosting.com/ticket/63</link>
+ <description>This exception is thrown when running:
+
+{{{
+nosetests --with-doctest .
+}}}
+
+And it's thrown by trying to iterate over the result of DocTest.py::loadTestsFromPath(), which returns None.
+
+My expectation (although I've only read the code diagonally), is for loadTestsFromModule() to find my doctests, and loadTestsFromPath() to be used for loading doctests from other places. I really haven't understood the purpose of loadTestsFromPath(), have I?
+
+I'll attach a patch right away, but I'm afraid I'm only masking the error somehow; please do look it over to see if that is what's correct.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 07 Apr 2006 03:23:58 GMT</pubDate>
+ <title>#35: profiler: output to stream or file</title>
+ <link>http://nose.python-hosting.com/ticket/35</link>
+ <description>The profiler plugin should be able to output to the results stream or a selected file.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 28 Mar 2006 04:24:27 GMT</pubDate>
+ <title>#28: Missing units</title>
+ <link>http://nose.python-hosting.com/ticket/28</link>
+ <description>Missing unittests for many core functions:
+ * loader testsInModule
+ * loader FunctionTestCase
+ * loader MethodTestCase
+ * LazySuite.run</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 13 Nov 2006 22:45:44 GMT</pubDate>
+ <title>#104: rewrite test loading/importing/suites to be easier to follow</title>
+ <link>http://nose.python-hosting.com/ticket/104</link>
+ <description>The code for test loading, suites and imports is convoluted and difficult to follow. It should be simplified and clarified.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Sun, 12 Nov 2006 15:33:08 GMT</pubDate>
+ <title>#103: Run fictures (setup/teardown) only for modules or packages that contain tests</title>
+ <link>http://nose.python-hosting.com/ticket/103</link>
+ <description>my directory structure:
+{{{
+proj/module1/__init__.py(has setup/teardown)
+ module1.py
+proj/module2/__init__.py(has setup/teardown)
+ module2.py
+}}}
+When I run below in proj dir:
+ nosetests module1 -vv
+I found although only module1.py is running but both module1 package setup/teardown and module2's has run.
+that means I have to run:
+ nosetests module1 -e module2
+to exclude module2.
+
+is there a way to run module1 package's test only? I know I could run `nosetest -w module1`, but this way can't call package setup/teardown.
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 11 Sep 2006 19:58:37 GMT</pubDate>
+ <title>#89: would like common interface for all test wrapper objects</title>
+ <link>http://nose.python-hosting.com/ticket/89</link>
+ <description>It would be convenient/efficient/and future-safe to access all of nose's internal test wrappers with a common interface. That is, convenient for the nose-watch plugin ;)
+
+Here is an initial idea, open to suggestions. I should point out that these are the only things that nose-watch needs to access, so a complete interface might want more.
+
+
+ * wrapper.getTestObject()
+ * the actual test (i.e. !FunctionTestCase.testFunc or !TestModule.module or unittest.!TestCase._'_class_'_)
+ * wrapper.getTestFile()
+ * this one has proven itself really tricky and maybe nose has a better way to do it since it is already looking for tests in the filesystem. Currently I am working around unloadable modules by overloading the load_source() method in ihooks.Hooks. There is also a big problem that I'm not sure is solvable in aliased modules (i.e. &#34;from main import foo&#34; when when foo.py exists in main/foo/foo.py, concealed by main/foo/__init__.py). I think inspect.getfile() is the one to blame for that, but I haven't looked into it too far other than knowing it's not working how I would like it.
+ * wrapper.getTestAddress()
+ * get a string &#34;address&#34; of a test. That is, a name that could be put on the command line of a nosetests call to run this test again. I'm thinking that any unittest.!TestCase method could only return the filename of its module?
+
+We should talk before you start work on this ... or perhaps I will just add a patch or two to this ticket if I get around to it first. I'll wait until 0.9.1 is out the door.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 25 Aug 2006 17:04:44 GMT</pubDate>
+ <title>#84: Generator tests with mutable arguments = bad</title>
+ <link>http://nose.python-hosting.com/ticket/84</link>
+ <description>From Kevin Dangoor:
+
+{{{
+A coworker found an interesting bug in test generators. Apparently,
+py.test does the same thing. Maybe this is architecturally difficult
+to contend with. Here's the test:
+
+#! /usr/bin/env python
+
+def test_list_loop():
+ def check_list_loop(ls, len_expected):
+ print ls
+ assert len(ls) == len_expected
+ ls = list()
+ for i in range(0, 6):
+ ls.append(i)
+ yield check_list_loop, ls, i + 1
+
+It appears that each yielded test is not run immediately, but is
+collected up and *then* run. In this particular case, that fails
+because a mutable object is involved (and mutated as part of the test
+running). Changing that last line to
+
+ yield check_list_loop, ls[:], i + 1
+
+makes it work, because you're dealing with copies of the list each time.
+}}}</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 16 Mar 2006 04:29:27 GMT</pubDate>
+ <title>#13: update selftest.py</title>
+ <link>http://nose.python-hosting.com/ticket/13</link>
+ <description>Update selftest to account for the new tests in units and unit support.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Mon, 18 Dec 2006 02:01:55 GMT</pubDate>
+ <title>#114: nosetests 0.9.1 leaks 0-byte temporary files under Windows</title>
+ <link>http://nose.python-hosting.com/ticket/114</link>
+ <description>I just noticed that nosetests 0.9.1 creates and leaves behind one
+temporary file each time it executes, running a test.
+
+Under Windows, the file are left in C:\Windows\Temp and have names
+similar to tmpxxxxx. It is probably a file name created by tempfile
+module function somewhere.
+
+These files should be deleted when nosetests terminates.
+
+I am not running any plugins.
+The test is very simple. Even an empty test creates a temp file leak.
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 18 Apr 2006 15:02:55 GMT</pubDate>
+ <title>#47: optimize startup time for lib/ test/ and package/ test/ cases</title>
+ <link>http://nose.python-hosting.com/ticket/47</link>
+ <description>Startup time for layouts like:
+ - lib/
+ - test/
+
+Or:
+ - package/
+ - test/
+
+Is very bad, since nose examines everyting in package/ and lib/ before looking in test/. This should be fixable, since it's only looking in the libs first to be sure that their root dirs are in sys.path before the tests are loaded.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 12 Oct 2006 19:28:00 GMT</pubDate>
+ <title>#97: @with_setup not calling teardown() if test raises exception</title>
+ <link>http://nose.python-hosting.com/ticket/97</link>
+ <description>I'm not sure if this is desired behvior or not, but I noticed that if a test function decorated with @with_setup() raises an exception then the teardown() method is not called. My personal choice is that a teardown function is called in a finally block as the test is run, to *always* undo what was done by setup.
+
+I took a [very] quick stab at adding a test to nose's suite for this but couldn't come up with one since setup and teardown are just properties set on the test method. hmm. Was using revision 98.
+
+-Kumar McMillan</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 05 Sep 2006 07:58:58 GMT</pubDate>
+ <title>#87: nose-django fails for apps with no models.py</title>
+ <link>http://nose.python-hosting.com/ticket/87</link>
+ <description>nose-django fails at nosedjango.py line 141, for any app which has no models.py (e.g. django/contrib/markup)
+
+Since it's not required to have a models.py file in every app, should begin() protect itself, e.g. only run management.install where load_app(app) is not None ?
+
+or you could say it's a fault in django. a blank models.py fixes it.
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Tue, 05 Sep 2006 14:55:03 GMT</pubDate>
+ <title>#88: call to debug log raises IndexError</title>
+ <link>http://nose.python-hosting.com/ticket/88</link>
+ <description>some straggler debug code from a condition yet to be evaluated is raising an IndexError. This is in selector.py, revision 94. Here is a patch.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 17 Aug 2006 20:28:12 GMT</pubDate>
+ <title>#82: NameError in class def *only* when running nosetests</title>
+ <link>http://nose.python-hosting.com/ticket/82</link>
+ <description>I could be missing something obvious, but this has me completely stumped. I figure you know more about the environment that nose imports code into so, I dunno, take a look and let me know what you think.
+
+Try this:
+
+{{{
+svn co --revision=238 http://svn.testtools.python-hosting.com/trunk/ testtools_238
+cd testtools_238
+nosetests -v testtools/testself/test_fixtures/test_storable.py
+}}}
+
+all tests should pass. now, open up testtools/testself/test_fixtures/test_storable.py and edit a few things :
+
+ * change mknewfile2 on line 241 to mknewfile
+ * change mknewfile2 on line 249 to mknewfile
+
+now run it again and you should get :
+
+{{{
+Traceback (most recent call last):
+ File &#34;/Users/kumar/tmp/tt_nose_flop/testtools/testtools/testself/test_fixtures/test_storable.py&#34;, line 246, in test_mknewfile
+ class MyAutoCsv(CsvFixture):
+ File &#34;/Users/kumar/tmp/tt_nose_flop/testtools/testtools/testself/test_fixtures/test_storable.py&#34;, line 247, in MyAutoCsv
+ class meta:
+ File &#34;/Users/kumar/tmp/tt_nose_flop/testtools/testtools/testself/test_fixtures/test_storable.py&#34;, line 249, in meta
+ mknewfile = mknewfile
+NameError: name 'mknewfile' is not defined
+}}}
+
+now ... to make sure we're all sane, shouldn't the exact same error happen when we simply compile the code?
+
+{{{
+python testtools/testself/test_fixtures/test_storable.py
+}}}
+
+Yet it does not. In addition, I have tried to reproduce a similar NameError in the python shell without success. And I've also tried taking that test function out of the unittest.TestCase class so that it is a standalone def, it still failed. I guess it's some kind of referencing issue but I can't think of any reason why this could happen *only* in nose.
+
+- kumar</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 21 Jul 2006 16:52:39 GMT</pubDate>
+ <title>#77: Importer bug for modules starting with underscore</title>
+ <link>http://nose.python-hosting.com/ticket/77</link>
+ <description>I will paste the session dump that presents the issue here. Files needed to reproduce this in attachement.
+
+{{{
+$ nosetests --verbose --include \(unit\)\|\(functional\)
+No handlers could be found for logger &#34;nose.plugins&#34;
+test_from_functional.TestFunctional.test_functional ... ok
+ERROR
+
+======================================================================
+ERROR: test module test_from_unit in /tmp/blah/tests/unit
+----------------------------------------------------------------------
+Traceback (most recent call last):
+ File &#34;/usr/lib/python2.3/site-packages/nose-0.9.1.dev_r77-py2.3.egg/nose/suite.py&#34;, line 44, in run
+ self.setUp()
+ File &#34;/usr/lib/python2.3/site-packages/nose-0.9.1.dev_r77-py2.3.egg/nose/suite.py&#34;, line 187, in setUp
+ self.module = _import(self.moduleName, [self.path], self.conf)
+ File &#34;/usr/lib/python2.3/site-packages/nose-0.9.1.dev_r77-py2.3.egg/nose/importer.py&#34;, line 96, in _import
+ mod = load_module(fqname, fh, filename, desc)
+ File &#34;/tmp/blah/tests/unit/test_from_unit.py&#34;, line 1, in ?
+ from _helper import fun1
+ImportError: cannot import name fun1
+
+----------------------------------------------------------------------
+Ran 1 test in 0.006s
+
+FAILED (errors=1)
+
+$ nosetests --verbose --include unit
+No handlers could be found for logger &#34;nose.plugins&#34;
+test_from_unit.TestUnit.test_unit ... ok
+
+----------------------------------------------------------------------
+Ran 1 test in 0.004s
+
+OK
+
+$ nosetests --verbose --include functional
+No handlers could be found for logger &#34;nose.plugins&#34;
+test_from_functional.TestFunctional.test_functional ... ok
+
+----------------------------------------------------------------------
+Ran 1 test in 0.004s
+
+OK
+}}}</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Fri, 09 Jun 2006 22:37:57 GMT</pubDate>
+ <title>#67: Hard to embed tests in existing modules</title>
+ <link>http://nose.python-hosting.com/ticket/67</link>
+ <description>I often like to put a few tests in my Python modules, and it would be nice to use 'nosetests' on them. However, nosetests fails to discover any tests because the modules aren't named test_*. Can we have a command-line option that looks for tests in the specified module regardless of its name? I tried making the module executable and using --exe but that didn't work.</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Thu, 01 Jun 2006 16:20:21 GMT</pubDate>
+ <title>#65: help text in doctest module inaccurate</title>
+ <link>http://nose.python-hosting.com/ticket/65</link>
+ <description>... it's just missing the env vars in the help text even though they were being accessed already. (see patch)</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 31 May 2006 23:47:20 GMT</pubDate>
+ <title>#64: activate non nose loggers through --debug</title>
+ <link>http://nose.python-hosting.com/ticket/64</link>
+ <description>I think that you should be able to activate other loggers for your application through --debug. Imagine I am unit testing a piece of code that uses the logger &#34;application.component&#34;. Now, in the normal run of the application the handler for this is set up by some piece of code that is not being run during the unit test. However, the unit tests fail, and I want to quickly activate the logger so I can see what went wrong. I think I should be able to write &#34;nosetests ---debug=application.component&#34; and see the log messages.
+
+I have attached a patch that fixes this.
+
+</description>
+ <category>Report</category>
+ </item>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <item>
+
+ <pubDate>Wed, 22 Mar 2006 17:05:47 GMT</pubDate>
+ <title>#20: nose 0.8.7.1 fails with TurboGears tests</title>
+ <link>http://nose.python-hosting.com/ticket/20</link>
+ <description>Running nosetests from the toplevel directory of a TurboGears trunk checkout fails after this:
+
+{{{
+ Full path to turbogears.fastdata.tests.formmodel is /Users/tazzzzz/projects/turbogears/turbogears.fastdata.tests.formmodel
+ test 'turbogears.fastdata.tests.formmodel' resolves to 'turbogears.fastdata.tests.formmodel' in '/Users/tazzzzz/projects/turbogears' (&lt;class 'nose.core.TestModule'&gt;)
+ running test test module turbogears.fastdata.tests.formmodel in /Users/tazzzzz/projects/turbogears
+ Import turbogears.fastdata.tests.formmodel from /Users/tazzzzz/projects/turbogears
+}}}
+
+It complains of the database not being configured. I am able to import formmodel without any problem from a python prompt, so it's not just an import that causes a problem. It seems like Nose is actually trying to run something in there.</description>
+ <category>Report</category>
+ </item>
+
+ </channel>
+</rss>
diff --git a/unit_tests/support/doctest/err_doctests.py b/unit_tests/support/doctest/err_doctests.py
new file mode 100644
index 0000000..6d60696
--- /dev/null
+++ b/unit_tests/support/doctest/err_doctests.py
@@ -0,0 +1,12 @@
+"""
+Module with errors in doctest formatting.
+
+ >>> 1
+ 'this is\n an error'
+"""
+def foo():
+ pass
+
+if __name__ == '__main__':
+ import doctest
+ doctest.testmod()
diff --git a/unit_tests/support/doctest/no_doctests.py b/unit_tests/support/doctest/no_doctests.py
new file mode 100644
index 0000000..7e3750e
--- /dev/null
+++ b/unit_tests/support/doctest/no_doctests.py
@@ -0,0 +1,9 @@
+"""
+Module without doctests.
+"""
+def foo():
+ pass
+
+if __name__ == '__main__':
+ import doctest
+ doctest.testmod()
diff --git a/unit_tests/support/issue006/tests.py b/unit_tests/support/issue006/tests.py
new file mode 100644
index 0000000..5c8ee60
--- /dev/null
+++ b/unit_tests/support/issue006/tests.py
@@ -0,0 +1,19 @@
+class Test1(object):
+ def test_nested_generator(self):
+ def func():
+ pass
+ yield func,
+
+ def test_nested_generator_mult(self):
+ def f2(a):
+ pass
+ for b in range(1, 4):
+ yield f2, b
+
+ def try_something(self, a):
+ pass
+
+ def test_normal_generator(self):
+ yield self.try_something, 1
+ yield 'try_something', 2
+
diff --git a/unit_tests/test_config.py b/unit_tests/test_config.py
index 2378bf6..272d2c0 100644
--- a/unit_tests/test_config.py
+++ b/unit_tests/test_config.py
@@ -1,7 +1,10 @@
import re
+import os
+import tempfile
import unittest
import nose.config
+
class TestNoseConfig(unittest.TestCase):
def test_defaults(self):
diff --git a/unit_tests/test_doctest_error_handling.py b/unit_tests/test_doctest_error_handling.py
new file mode 100644
index 0000000..0b0fd5e
--- /dev/null
+++ b/unit_tests/test_doctest_error_handling.py
@@ -0,0 +1,46 @@
+import os
+import sys
+import unittest
+from nose.config import Config
+from nose.plugins import doctests
+from mock import Bucket
+
+# some plugins have 2.4-only features
+compat_24 = sys.version_info >= (2, 4)
+
+class TestDoctestErrorHandling(unittest.TestCase):
+
+ def setUp(self):
+ self._path = sys.path[:]
+ here = os.path.dirname(__file__)
+ testdir = os.path.join(here, 'support', 'doctest')
+ sys.path.insert(0, testdir)
+ p = doctests.Doctest()
+ p.can_configure = True
+ p.configure(Bucket(), Config())
+ self.p = p
+
+ def tearDown(self):
+ sys.path = self._path[:]
+
+ def test_no_doctests_in_file(self):
+ p = self.p
+ mod = __import__('no_doctests')
+ loaded = [ t for t in p.loadTestsFromModule(mod) ]
+ assert not loaded, "Loaded %s from empty module" % loaded
+
+ def test_err_doctests_raises_exception(self):
+ p = self.p
+ mod = __import__('err_doctests')
+ try:
+ loaded = [ t for t in p.loadTestsFromModule(mod) ]
+ except ValueError:
+ pass
+ else:
+ if compat_24:
+ self.fail("Error doctests file did not raise ValueError")
+ else:
+ self.assert_(loaded,
+ "No value error, nothing loaded from err tests")
+if __name__ == '__main__':
+ unittest.main()
diff --git a/unit_tests/test_issue_006.py b/unit_tests/test_issue_006.py
new file mode 100644
index 0000000..d04c174
--- /dev/null
+++ b/unit_tests/test_issue_006.py
@@ -0,0 +1,31 @@
+import os
+import unittest
+
+class TestIssue006(unittest.TestCase):
+ def test_load_nested_generator(self):
+ from nose.config import Config
+ from nose.loader import TestLoader
+
+ where = os.path.abspath(os.path.join(os.path.dirname(__file__),
+ 'support', 'issue006'))
+ l = TestLoader()
+ testmod = iter(l.loadTestsFromName(where)).next()
+ print testmod
+ testmod.setUp()
+
+ testcase = iter(testmod).next()
+ expect = [
+ ['tests.Test1.test_nested_generator'],
+ ['tests.Test1.test_nested_generator_mult(1,)',
+ 'tests.Test1.test_nested_generator_mult(2,)',
+ 'tests.Test1.test_nested_generator_mult(3,)'],
+ ['tests.Test1.test_normal_generator(1,)',
+ 'tests.Test1.test_normal_generator(2,)']
+ ]
+ for test in testcase:
+ tests = map(str, test)
+ print tests
+ self.assertEqual(tests, expect.pop(0))
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/unit_tests/test_plugins.py b/unit_tests/test_plugins.py
index 3999819..e00807f 100644
--- a/unit_tests/test_plugins.py
+++ b/unit_tests/test_plugins.py
@@ -90,6 +90,8 @@ class TestDoctestPlugin(unittest.TestCase):
assert len(parser.opts) == 2
def test_config(self):
+ if not compat_24:
+ return
# test that configuration works properly when both environment
# and command line specify a doctest extension
parser = OptionParser()
@@ -267,6 +269,20 @@ class TestAttribPlugin(unittest.TestCase):
assert plug.wantFunction(f) is not False
assert not plug.wantFunction(g)
+ def test_class_attr(self):
+ class TestP:
+ foo = True
+ def h():
+ pass
+
+ def i():
+ pass
+
+ plug = AttributeSelector()
+ plug.attribs = [[('foo', True)]]
+ assert plug.wantMethod(TestP.h) is not False
+ assert plug.wantFunction(i) is False
+
def test_eval_attr(self):
if not compat_24:
warn("No support for eval attributes in python versions older"
@@ -355,8 +371,11 @@ class TestProfPlugin(unittest.TestCase):
def test_begin(self):
plug = Profile()
plug.pfile = tempfile.mkstemp()[1]
- plug.begin()
- assert plug.prof
+ try:
+ plug.begin()
+ assert plug.prof
+ finally:
+ plug.finalize(None)
def test_prepare_test(self):
r = {}
@@ -369,8 +388,25 @@ class TestProfPlugin(unittest.TestCase):
plug = Profile()
plug.prof = dummy()
result = plug.prepareTest(func)
- result(r)
- assert r[1] == ("func", "wrapped")
-
+ try:
+ result(r)
+ assert r[1] == ("func", "wrapped")
+ finally:
+ plug.finalize(None)
+
+ def test_finalize(self):
+ def func():
+ pass
+
+ plug = Profile()
+ plug.begin()
+ plug.prepareTest(func)
+ pfile = plug.pfile
+ try:
+ assert os.path.exists(pfile)
+ finally:
+ plug.finalize(None)
+ assert not os.path.exists(pfile)
+
if __name__ == '__main__':
unittest.main()
diff --git a/unit_tests/test_tools.py b/unit_tests/test_tools.py
index d682291..e5a1ae2 100644
--- a/unit_tests/test_tools.py
+++ b/unit_tests/test_tools.py
@@ -1,7 +1,10 @@
+import sys
import time
import unittest
from nose.tools import *
+compat_24 = sys.version_info >= (2, 4)
+
class TestTools(unittest.TestCase):
def test_ok(self):
@@ -90,6 +93,62 @@ class TestTools(unittest.TestCase):
assert f2.setup == 'setup'
assert f2.teardown == 'teardown'
+
+ def test_nested_decorators(self):
+ from nose.tools import raises, timed, with_setup
+
+ def test():
+ pass
+
+ def foo():
+ pass
+
+ test = with_setup(foo, foo)(test)
+ test = timed(1.0)(test)
+ test = raises(TypeError)(test)
+ assert test.setup == foo
+ assert test.teardown == foo
+
+ def test_decorator_func_sorting(self):
+ from nose.tools import raises, timed, with_setup
+ from nose.util import func_lineno
+
+ def test1():
+ pass
+
+ def test2():
+ pass
+
+ def test3():
+ pass
+
+ def foo():
+ pass
+
+ test1_pos = func_lineno(test1)
+ test2_pos = func_lineno(test2)
+ test3_pos = func_lineno(test3)
+
+ test1 = raises(TypeError)(test1)
+ test2 = timed(1.0)(test2)
+ test3 = with_setup(foo)(test3)
+
+ self.assertEqual(func_lineno(test1), test1_pos)
+ self.assertEqual(func_lineno(test2), test2_pos)
+ self.assertEqual(func_lineno(test3), test3_pos)
+
+ def test_testcase_funcs(self):
+ import nose.tools
+ tc_asserts = [ at for at in dir(nose.tools)
+ if at.startswith('assert_') ]
+ print tc_asserts
+
+ # FIXME: not sure which of these are in all supported
+ # versions of python
+ assert 'assert_raises' in tc_asserts
+ if compat_24:
+ assert 'assert_true' in tc_asserts
+
if __name__ == '__main__':
unittest.main()
diff --git a/unit_tests/test_twisted.py b/unit_tests/test_twisted.py
index 928afd7..76b5718 100644
--- a/unit_tests/test_twisted.py
+++ b/unit_tests/test_twisted.py
@@ -8,26 +8,30 @@ class CustomError(Exception):
pass
# Should succeed unless python-hosting is down
-@deferred()
+#@deferred
def test_resolve():
return reactor.resolve("nose.python-hosting.com")
+test_resolve = deferred()(test_resolve)
# Raises TypeError because the function does not return a Deferred
-@raises(TypeError)
-@deferred()
+#@raises(TypeError)
+#@deferred()
def test_raises_bad_return():
reactor.resolve("nose.python-hosting.com")
+test_raises_bad_return = raises(TypeError)(deferred()(test_raises_bad_return))
# Check we propagate twisted Failures as Exceptions
# (XXX this test might take some time: find something better?)
-@raises(DNSLookupError)
-@deferred()
+#@raises(DNSLookupError)
+#@deferred()
def test_raises_twisted_error():
return reactor.resolve("x.y.z")
+test_raises_twisted_error = raises(DNSLookupError)(
+ deferred()(test_raises_twisted_error))
# Check we detect Exceptions inside the callback chain
-@raises(CustomError)
-@deferred(timeout=1.0)
+#@raises(CustomError)
+#@deferred(timeout=1.0)
def test_raises_callback_error():
d = Deferred()
def raise_error(_):
@@ -37,29 +41,40 @@ def test_raises_callback_error():
d.addCallback(raise_error)
reactor.callLater(0.01, finish)
return d
+test_raises_callback_error = raises(CustomError)(
+ deferred(timeout=1.0)(test_raises_callback_error))
# Check we detect Exceptions inside the test body
-@raises(CustomError)
-@deferred(timeout=1.0)
+#@raises(CustomError)
+#@deferred(timeout=1.0)
def test_raises_plain_error():
raise CustomError
+test_raises_plain_error = raises(CustomError)(
+ deferred(timeout=1.0)(test_raises_plain_error))
# The deferred is triggered before the timeout: ok
-@deferred(timeout=1.0)
+#@deferred(timeout=1.0)
def test_timeout_ok():
d = Deferred()
def finish():
d.callback(None)
reactor.callLater(0.01, finish)
return d
+test_timeout_ok = deferred(timeout=1.0)(test_timeout_ok)
# The deferred is triggered after the timeout: failure
-@raises(TimeExpired)
-@deferred(timeout=0.1)
+#@raises(TimeExpired)
+#@deferred(timeout=0.1)
def test_timeout_expired():
d = Deferred()
def finish():
d.callback(None)
reactor.callLater(1.0, finish)
return d
+test_timeout_expired = raises(TimeExpired)(
+ deferred(timeout=0.1)(test_timeout_expired))
+
+if __name__ == '__main__':
+ from nose import runmodule
+ runmodule()
diff --git a/unit_tests/test_twisted_testcase.py b/unit_tests/test_twisted_testcase.py
new file mode 100644
index 0000000..6631dce
--- /dev/null
+++ b/unit_tests/test_twisted_testcase.py
@@ -0,0 +1,6 @@
+from twisted.trial import unittest
+
+class TestTwisted(unittest.TestCase):
+
+ def test(self):
+ pass