Opened 16 years ago

Last modified 16 years ago

#1207 enhancement closed fixed (fixed)

--coverage should be a flag, not a parameter

Reported by: Jonathan Lange Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: radix, spiv, Jonathan Lange, marienz Branch:


Change History (12)

comment:1 Changed 16 years ago by Jonathan Lange

This will require deprecating the parameter behaviour, releasing, then removing
the parameter behaviour.

comment:2 Changed 16 years ago by spiv

Can you elaborate on the precise behaviour of the flag?  Where is coverage data
saved?  Can coverage data be accumulated between runs?  The Zope 3 test runner
has a flag for this, with the following behaviour:

    Use the trace module from Python for code coverage.  The current
    utility writes coverage files to a directory named `coverage' that
    is parallel to `build'.  It also prints a summary to stdout.

It is probably worth being as similar to this as makes sense, to make my life as
easy as possible :)

comment:3 Changed 16 years ago by Jonathan Lange

Most likely behaviour: writing files to a directory named 'coverage' under

We can even call the option 'trace' if it will make you happy -- although that
will make deprecation a little more involved.

comment:4 Changed 16 years ago by spiv

Actually, I think "trace" is a crap name for this option, so forget I suggested
copying that part ;)

Calling it --coverage and writing to _trial_temp/coverage is completely fine
with me.  The summary on stdout (list modules and coverage percentages) may be
nice, or perhaps too unwieldly to be useful.  I can live without it.

Random thought: for coverage, it would be nice if there were some way to include
coverage stats of spawned subprocesses in the final result.  Tricky to do, and
out of scope for this issue, though :)

comment:5 Changed 16 years ago by Jonathan Lange

I'm not sure this is possible.

There doesn't appear to be a way (with t.p.usage) to have 
  $ trial --coverage twisted.trial
  $ trial --coverage=cov twisted.trial
work in sane ways.

comment:6 Changed 16 years ago by radix

*especially* given that "trial --coverage cov" is valid syntax. There's no way
to distinguish the value of the --coverage parameter from a general
whole-command-line "argument", or whatever they're called.

comment:7 Changed 16 years ago by Jonathan Lange

OK.  So gimme a new deprecation plan :)

comment:8 Changed 16 years ago by radix

break it!

comment:9 Changed 16 years ago by Jonathan Lange

Rather than break it, I issue a deprecation warning.
Will break it in 2.2

Leaving this one open

comment:10 Changed 16 years ago by marienz

It's a shame --coverage is really the best name for the option I can think of,
or I'd say deprecate the option entirely and add a new flag with a different
name. Also, a short form of --coverage wouldn't hurt, -c seems to be free. Would
it be worth it to add -c as a flag, and then in the future make --coverage
identical to -c?

comment:11 Changed 16 years ago by Jonathan Lange

Resolved in SVN head

comment:12 Changed 11 years ago by <automation>

Owner: Jonathan Lange deleted
Note: See TracTickets for help on using tickets.