Zachary Ware added the comment:
Terry J. Reedy added the comment:
The problem is that this permissiveness does not apply to subsidiary files
discovered from and run by a main file, even though it should. The current
workaround is to explicitly set use_resources for the benefit of subsidiary
R. David Murray added the comment:
Since we only use unittest for running subsets of our test suite, I think the
better behavior is to run everything that -u all normally runs. That is, when
one uses unittest to run a bit of the test suite, one generally wants to run
the tests one specifies,
Terry J. Reedy added the comment:
Currently, all requires() tests pass when the file they occur in is run as
'__main__'. This is especially needed when the file ends with the now standard
boilerplate.
if __name__ == '__main__':
...
unittest.main(...)
as there is currently no way
Terry J. Reedy added the comment:
#18441 is partly related in that it also suggests (eventually) moving check
code (for guis) from multiple test files to support and regrtest. I do not
believe there would be any conflict.
--
___
Python tracker
New submission from Zachary Ware:
Here's a patch to implement the idea I posted in issue18258, msg193242. The
patch also removes usage of support.use_resources = ['resource'] from the
test package since it is no longer needed.
(No test_main - unittest.main conversions are done in this patch;
Serhiy Storchaka added the comment:
I don't think we should accept anything if not running under regrtest, We can
unintentionally run a testfile in which some tests consume a lot of resources.
Also we need in skipping this tests for the test testing. I think it will be
better just add a