My recollection is yes, nose persists which tests passed/failed for
the previous run, but I don't recall where.
Personally, I've never used this (except to see how it works in nose)
because I'm always concerned that while a recent change may fix a
failing test, it could cause some other test to fail that previously
passed. So I'm going to run the whole test suite anyway - or at least
all the tests for that module, etc.
Alex suggestion of --failfast seems like a much more useful way to
shorten test runs.
--
----
\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg
The nose test-runner that I'm currently using is at
http://gist.github.com/197593. (The code I point to in the blog has
gotten more convoluted than I'd like; it turns out that can be a
problem if you're pointing at a vcs repo.)
For the most part, switching test runners is simple since Django
exposes all the setup and teardown functions. The hacky part is
passing extra arguments to nose: Django doesn't recognize nose
arguments so it complains and dies if you try something like
`./manage.py test --pdb-fail`. Since I just wanted to get something
working, I pass all arguments after a '--' on the command line to nose
and Django happily ignores them. If something like nose_runner is
shipped with Django it should run normally and be able to show the
same help screen that `nose --help` shows.
It was one of those "I'll come back and fix it later" sort of things. ;)
Cheers,
jeff
I'm yet to be convinced that Nose should be the default test runner
for the simple reason that it doesn't come out of the box with Python.
However, I agree that using Nose with Django should be as painless as
possible. I included the TEST_RUNNER setting specifically for this
reason.
I haven't seen any reports in Trac that the capabilities of
TEST_RUNNER aren't suitable for the task, and I've seen several
snippets and blog posts indicating that Nose can be used with Django.
If I'm incorrect on this, please let me know (or better still, open a
ticket in Trac).
Then there is the issue of whether Django should be responsible for
shipping a Nose-compatible test runner, or whether that is Nose's
responsibility. Historically, I've been of the opinion that it should
be Nose's responsibility to ship a test runner, but I'm open to other
opinions on this.
I'm slightly hesitant to start building extra features like --failfast
into Django's testing tools, especially when tools like Nose already
cover this territory. Django isn't a test framework tool, and I'm
hesitant to support proposals that try to turn it into one.
Russ %-)
I've updated the script at
https://gist.github.com/197593/9763da971f67c2c3bd25b2a7e4754e8b5d625087
to expose nose options as test_runner.options. Mixing options for the
two packages is kind of hairy, but I don't think any of that is
exposed to developers running the tests.
Integrating outside options will require a patch to
core/management/commands/test.py to import a test runner and ask it if
it has extra options. Importing the test runner before creating the
Command class should be backwards compatible unless people are writing
test runners that import test.py (there'd be a circular import issue).
It looks like this: http://gist.github.com/197797.
I'll get a proper bug filed if this looks acceptable/interesting.
From the point of view of encouraging the usage of nose, either would work fine. I think this is fits in to the conversation at DjangoCon about how we should go about encouraging Django users to explore the wider Python ecosystem. The important thing is that we can have some official (or semi-official) documentation somewhere saying "to access enhanced test running commands, install nose and drop this string in to your TEST_RUNNER setting." The string itself could point at dango.something or nose.something, the important thing from my point of view is that they don't have to grab a test runner script from another third party, then figure out where to put it within their project. If nose don't want to ship the test runner, I'd be fine with putting it in django.contrib somewhere.It's hard to get people to write tests. It's hard to get them to document their work. I wouldn't care if it's in Nose or Django that has the test runner, just as long as doing an "easy_install nose" and changing the TEST_RUNNER is all a user has to do to make the switch. I just can't imagine the Nose guys including a Django test runner in their base install. Maybe I'm wrong.
while testing, when i found some not-obvious test failure and i have
to run the test repeatedly, i try to run just this one until it
passes. then i rerun the whole set.
it would be very nice to have a flat to run just the ones that failed
last time. after that, rerun the whole thing.
in the (very rare) case that fixing a test breaks another, it would be
caught by the full run at the end, maybe there could be an option so
that:
- if there's no 'failure record' run all
- if there's some record, first test those that have failed the last time
- if they still fail, stop there
- if there's no further failures, rerun the whole set
that seems the easiest use, while still not running unrelated tests
again and again.
--
Javier
- if there's no 'failure record' run all
- if there's some record, first test those that have failed the last time
- if they still fail, stop there
- if there's no further failures, rerun the whole set