Nick Coghlan added the comment:

Nothing too complicated - just noting that a test suite like ours that launches 
Python subprocesses to test process global state handling could fairly easily 
arrange to pass appropriate -C options to trigger things like recording 
coverage data or profiling options.

I'll also note that if you put a "preinit.py" on sys.path (e.g. in the current 
directory if using -m for invocation), you could easily do "-C 'import 
preinit'" to do arbitrarily complex custom setups, including preconfiguring 
your test framework.

A lot of my thoughts on this come out of looking into migrating the various 
stdlib modules like trace, pdb and profile over to supporting everything that 
runpy (and hence the main executable) supports, and a lot of the complexity 
lies in the mechanics of how to daisy chain the two "__main__" modules 
together. Running a bit of extra code in __main__ as supplied on the command 
line before kicking off the full import process helps avoid a lot of pain.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14803>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to