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 Alexander.Belopolsky
Recipients Alexander.Belopolsky, belopolsky, eli.bendersky, terry.reedy
Date 2010-07-21.14:06:35
SpamBayes Score 0.00029782337
Marked as misclassified No
Message-id <AANLkTikvT_YLnzDpl9fkjnVkyFop9ba8nVXO9EzUIdJO@mail.gmail.com>
In-reply-to <AANLkTikBDTBs9oFv0RRsEN_duURS67Ew85yx-0A82-8S@mail.gmail.com>
Content
On Wed, Jul 21, 2010 at 9:45 AM, Eli Bendersky <report@bugs.python.org> wrote:
..
> As far as I understand, when you run:
>
>    py3d -m trace -C pickle-trace.d -c -m test_pickle.py
>
> The first -m flag applies to the trace module. Python uses
> runpy.run_module to load it, and then passes it its arguments (-C and
> onwards).
>
When I said "run from command line", I meant something like

$ python Lib/test/test_pickle.py

I am not sure if this uses runpy machinery, but I suspect it does.

 The trace output should not include runpy calls that load the trace
module itself, but

$ python -m trace <flags> Lib/test/test_pickle.py

might show the runpy calls that occur when you run

$ python Lib/test/test_pickle.py

without tracing.   BTW, too bad that '-m' is taken, but I think
trace.py should grow a --run-module option so that you can trace
equivalents of python -m executions:

$ python -m trace <flags> --run-module test.test_pickle

> Moreover, since runpy is only the machinery to execute trace.py, does
> it even make sense to include it in coverage?
>
> What do you think?

I think you should ask python-dev. :-)  Note that most C/C++ coverage
tools do include  pre-main calls in coverage.  In case of C++, a lot
of things may happen before main().

Whatever the solution is, it should be unified between trace, profile,
and pdb modules.
History
Date User Action Args
2010-07-21 14:06:37Alexander.Belopolskysetrecipients: + Alexander.Belopolsky, terry.reedy, belopolsky, eli.bendersky
2010-07-21 14:06:35Alexander.Belopolskylinkissue9317 messages
2010-07-21 14:06:35Alexander.Belopolskycreate