{6} All Tickets By Milestone (Including closed) (121 matches)

A more complex example to show how to make advanced reports.

1.0

Ticket Summary Component Status Resolution Version Severity Priority Owner Description Modified
#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.

09/13/06
#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

08/28/06
#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 --.

05/14/06
#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

08/04/06
#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.

03/27/06

0.9rc1

Ticket Summary Component Status Resolution Version Severity Priority Owner Description Modified
#27 Missing units nose closed fixed 0.9a1 major high jpellerin

Missing unittests for many core functions:

06/22/06

0.9b1

Ticket Summary Component Status Resolution Version Severity Priority Owner Description Modified
#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.

05/24/06
#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.

05/24/06
#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.

05/24/06

0.9a2

Ticket Summary Component Status Resolution Version Severity Priority Owner Description Modified
#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)
05/08/06
#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.

05/08/06
#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.

05/08/06
#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.

05/08/06
#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

05/06/06
#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 ...

05/04/06

0.9a1

Ticket Summary Component Status Resolution Version Severity Priority Owner Description Modified
#50 Update mkrelease nose closed fixed 0.9 normal high jpellerin

Update mkrelease to make svn/svk branch and tag instead of bzr.

04/30/06
#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.

04/26/06
#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
04/26/06
#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).

04/24/06
#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.

04/23/06
#46 super? nose closed fixed 0.9 normal normal jpellerin

Check usage of super() vs direct init calls. Ref: http://fuhm.net/super-harmful/

04/23/06
#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.

04/23/06
#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.

04/19/06
#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.

04/16/06
#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.

04/16/06
#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
04/16/06
#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.

04/16/06
#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.

04/16/06
#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.

04/16/06
#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.

04/12/06
#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:

   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)

04/10/06
#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.

04/10/06
#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.

04/10/06
#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
04/06/06
#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.

04/06/06
#22 loading tests from classes: beware subclassing nose closed fixed 0.9 normal normal jpellerin

The following case will currently result in wrong behavior:


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

04/02/06
#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.

04/02/06
#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.

03/29/06
#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
03/29/06
#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?.

03/27/06
#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

03/27/06
#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.

03/26/06
#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:

Add more details to this ticket.

03/26/06
#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')

03/23/06
#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).

03/23/06
#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).

03/23/06
#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'

03/19/06
#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.

03/19/06
#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
03/15/06
#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.

03/15/06
#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.

03/14/06
#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.

03/14/06
#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

03/12/06
#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.

03/11/06

0.9.2

Ticket Summary Component Status Resolution Version Severity Priority Owner Description Modified
#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

12/13/06
#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.

12/02/06
#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?.

12/01/06
#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.

11/22/06
#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.

11/21/06
#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.

10/28/06
#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?

12/13/06
#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.

11/07/06
#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

12/06/06