This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Todd.Rovito, ezio.melotti, ncoghlan, ned.deily, r.david.murray, terry.reedy
Date 2013-06-16.02:44:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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 and, 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:18terry.reedysetrecipients: + terry.reedy, ncoghlan, ned.deily, ezio.melotti, r.david.murray, Todd.Rovito
2013-06-16 02:44:18terry.reedysetmessageid: <>
2013-06-16 02:44:18terry.reedylinkissue18103 messages
2013-06-16 02:44:17terry.reedycreate