Message191255
Thanks. That still leaves the problem of getting all tests to run during development when running them with unittest. Calling requires('gui') passes when (_is_gui_available() and (caller is __main__ or 'gui' in use_resources)). Use_resources is normally set by regrtest. As far as I saw, most other support functions work fine with unittest and are not dependent on regrtest.
The doc for unittest.main say that the argv argument can be a list of options passed to the program. Which program? Can that be used to set a resource?
I plan to try
from test import support; support.use_resources = ['gui']
in the 'if __name__ ...' sections of xyz.py and test_idle.py, but that will not work from the command line ('python -m unittest whatever').
An alternative is to have requires() check whether the test is running under regrtest (which supposedly changes support.verbose from 1 (which it starts as) to 0) and passing, at least for 'gui', if not. (Is there any other way for a test to detect the test runner?) |
|
Date |
User |
Action |
Args |
2013-06-16 02:44:18 | terry.reedy | set | recipients:
+ terry.reedy, ncoghlan, ned.deily, ezio.melotti, r.david.murray, Todd.Rovito |
2013-06-16 02:44:18 | terry.reedy | set | messageid: <1371350658.15.0.364017562484.issue18103@psf.upfronthosting.co.za> |
2013-06-16 02:44:18 | terry.reedy | link | issue18103 messages |
2013-06-16 02:44:17 | terry.reedy | create | |
|