running the tests...
Hi All, I found the very brief snippet on test-running at: http://python.org/dev/faq/#how-to-test-a-patch ...so thought I'd ask here: - what's the canonical way to run "all the tests"? - what's the canonical way to run the tests for just the package being patched? (I'm assuming it's a standard library package here...) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers schrieb:
Hi All,
I found the very brief snippet on test-running at:
http://python.org/dev/faq/#how-to-test-a-patch
....so thought I'd ask here:
- what's the canonical way to run "all the tests"?
Assuming UNIXy OSes: make test, or if you want to save a bit of time, make quicktest.
- what's the canonical way to run the tests for just the package being patched? (I'm assuming it's a standard library package here...)
In 90% of all cases, the test suite is called like the module, so ./python Lib/test/regrtest.py test_foo where foo is the module name should do it. In the other 10%, you'll have to look around a bit for the tests. But since patching should always include adding a test, it's necessary anyway ;) cheers, Georg
Georg Brandl wrote:
Chris Withers schrieb:
Hi All,
I found the very brief snippet on test-running at:
http://python.org/dev/faq/#how-to-test-a-patch
....so thought I'd ask here:
- what's the canonical way to run "all the tests"?
Assuming UNIXy OSes: make test, or if you want to save a bit of time, make quicktest.
- what's the canonical way to run the tests for just the package being patched? (I'm assuming it's a standard library package here...)
In 90% of all cases, the test suite is called like the module, so
./python Lib/test/regrtest.py test_foo
where foo is the module name should do it. In the other 10%, you'll have to look around a bit for the tests. But since patching should always include adding a test, it's necessary anyway ;)
My personal preferences: Thorough: ./python -m test.regrtest -uall Typical: ./python -m test.regrtest Specific: ./python -m test.regrtest test_mod1 test_mod2 (enabling the relevant test resources via -uall or something more specific is especially important when working on things like the networking code or the audio support - many of the relevant tests are skipped by default) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia ---------------------------------------------------------------
Nick Coghlan wrote:
My personal preferences:
Thorough: ./python -m test.regrtest -uall Typical: ./python -m test.regrtest Specific: ./python -m test.regrtest test_mod1 test_mod2
This looks good, I assume this would work on Windows too? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
>> My personal preferences: >> >> Thorough: ./python -m test.regrtest -uall >> Typical: ./python -m test.regrtest >> Specific: ./python -m test.regrtest test_mod1 test_mod2 Chris> This looks good, I assume this would work on Windows too? I believe so, but <wink><jab>you should still get a real OS.</jab></wink> Skip
skip@pobox.com wrote:
>> My personal preferences: >> >> Thorough: ./python -m test.regrtest -uall >> Typical: ./python -m test.regrtest >> Specific: ./python -m test.regrtest test_mod1 test_mod2
Chris> This looks good, I assume this would work on Windows too?
I believe so, but <wink><jab>you should still get a real OS.</jab></wink>
I do use plenty of real operating systems, but one of python's biggest strengths for me is that it is totally cross platform... ...that and the soundcard in my desktop machine only has windows drivers :-( *cough* Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers wrote:
Nick Coghlan wrote:
My personal preferences:
Thorough: ./python -m test.regrtest -uall Typical: ./python -m test.regrtest Specific: ./python -m test.regrtest test_mod1 test_mod2
This looks good, I assume this would work on Windows too?
Yep - and of course, you can even leave out the ./ in that case. (Oh, if for some reason you're working on a Python 2.4 or earlier build, the above won't work, since -m only started supporting running modules inside packages in 2.5) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia ---------------------------------------------------------------
participants (4)
-
Chris Withers -
Georg Brandl -
Nick Coghlan -
skip@pobox.com