Thu Nov 16 14:59:35 2006

Ticket #105 (Closed: fixed)

nose 0.9.1 does not run functional tests in order of appearance in the module


Priority: normal Reporter: prouleau001@gmail.com
Severity: normal Assigned to: jpellerin
Component: nose:collector Status: closed
Version: 0.9.1 Resolution: fixed
Milestone: 0.9.2 Keywords:  

Description by prouleau001@gmail.com:

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.

Changelog

Tue Nov 21 09:31:06 2006: Modified by jpellerin

  • description changed.
  • milestone set to 0.9.2
  • status changed from new to assigned

Tue Dec 5 16:30:38 2006: Modified by jpellerin

  • resolution set to fixed
  • status changed from assigned to closed

Fixed with tests as of [137]. The problem here is decorators, specifically decorators that replace the decorated function with a new function without carrying over the decorated function's attributes. All decorators in nose.tools do this correctly now, but other decorators that misbehave will result in tests being run out of order -- or not at all.