From 4355fa45cd548c5f5b33396405b718062aefe818 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 5 Dec 2009 17:53:53 -0500 Subject: Clean-ups --- CHANGES.txt | 784 ++++++++++++++++++++-------------------- README.txt | 18 +- TODO.txt | 422 ++++++++++----------- doc/sample_html/README.txt | 10 +- lab/cmd-opts.txt | 20 +- lab/dataflow.txt | 4 +- test/backtest.py | 2 +- test/coveragetest.py | 10 +- test/farm/annotate/run_multi.py | 2 +- test/farm/html/run_tabbed.py | 2 +- test/farm/html/src/b.py | 2 +- test/farm/html/src/tabbed.py | 2 +- test/stress_phystoken.txt | 1 + 13 files changed, 640 insertions(+), 639 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 1c9359c2..f191b294 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,392 +1,392 @@ ------------------------------- -Change history for Coverage.py ------------------------------- - - -Version 3.3 ------------ - -- Settings are now read from a .coveragerc file. - - -Version 3.2, 5 December 2009 ----------------------------- - -- Added a --version options on the command line. - - -Version 3.2b4, 1 December 2009 ------------------------------- - -- Branch coverage improvements: - - - The XML report now includes branch information. - -- Click-to-sort HTML report columns are now persisted in a cookie. Viewing - a report will sort it first the way you last had a coverage report sorted. - Thanks, `Chris Adams`_. - -- On Python 3.x, setuptools has been replaced by `Distribute`_. - -.. _Distribute: http://packages.python.org/distribute/ - - -Version 3.2b3, 23 November 2009 -------------------------------- - -- Fixed a memory leak in the C tracer that was introduced in 3.2b1. - -- Branch coverage improvements: - - - Branches to excluded code are ignored. - -- The table of contents in the HTML report is now sortable: click the headers - on any column. Thanks, `Chris Adams`_. - -.. _Chris Adams: http://improbable.org/chris/ - - -Version 3.2b2, 19 November 2009 -------------------------------- - -- Branch coverage improvements: - - - Classes are no longer incorrectly marked as branches: `issue 32`_. - - - "except" clauses with types are no longer incorrectly marked as branches: - `issue 35`_. - -- Fixed some problems syntax coloring sources with line continuations and - source with tabs: `issue 30`_ and `issue 31`_. - -- The --omit option now works much better than before, fixing `issue 14` and - `issue 33`_. Thanks, Danek Duvall. - -.. _issue 14: http://bitbucket.org/ned/coveragepy/issue/14 -.. _issue 30: http://bitbucket.org/ned/coveragepy/issue/30 -.. _issue 31: http://bitbucket.org/ned/coveragepy/issue/31 -.. _issue 32: http://bitbucket.org/ned/coveragepy/issue/32 -.. _issue 33: http://bitbucket.org/ned/coveragepy/issue/33 -.. _issue 35: http://bitbucket.org/ned/coveragepy/issue/35 - - -Version 3.2b1, 10 November 2009 -------------------------------- - -- Branch coverage! - -- XML reporting has file paths that let Cobertura find the source code. - -- The tracer code has changed, it's a few percent faster. - -- Some exceptions reported by the command line interface have been cleaned up - so that tracebacks inside coverage.py aren't shown. Fixes `issue 23`_. - -.. _issue 23: http://bitbucket.org/ned/coveragepy/issue/23 - - -Version 3.1, 4 October 2009 ---------------------------- - -- Source code can now be read from eggs. Thanks, Ross Lawley. Fixes - `issue 25`_. - -.. _issue 25: http://bitbucket.org/ned/coveragepy/issue/25 - - -Version 3.1b1, 27 September 2009 --------------------------------- - -- Python 3.1 is now supported. - -- Coverage.py has a new command line syntax with sub-commands. This expands - the possibilities for adding features and options in the future. The old - syntax is still supported. Try "coverage help" to see the new commands. - Thanks to Ben Finney for early help. - -- Added an experimental "coverage xml" command for producing coverage reports - in a Cobertura-compatible XML format. Thanks, Bill Hart. - -- Added the --timid option to enable a simpler slower trace function that works - for DecoratorTools projects, including TurboGears. Fixed `issue 12`_ and - `issue 13`_. - -- HTML reports show modules from other directories. Fixed `issue 11`_. - -- HTML reports now display syntax-colored Python source. - -- Programs that change directory will still write .coverage files in the - directory where execution started. Fixed `issue 24`_. - -- Added a "coverage debug" command for getting diagnostic information about the - coverage.py installation. - -.. _issue 11: http://bitbucket.org/ned/coveragepy/issue/11 -.. _issue 12: http://bitbucket.org/ned/coveragepy/issue/12 -.. _issue 13: http://bitbucket.org/ned/coveragepy/issue/13 -.. _issue 24: http://bitbucket.org/ned/coveragepy/issue/24 - - -Version 3.0.1, 7 July 2009 --------------------------- - -- Removed the recursion limit in the tracer function. Previously, code that - ran more than 500 frames deep would crash. Fixed `issue 9`. - -- Fixed a bizarre problem involving pyexpat, whereby lines following XML parser - invocations could be overlooked. Fixed `issue 10`. - -- On Python 2.3, coverage.py could mis-measure code with exceptions being - raised. This is now fixed. - -- The coverage.py code itself will now not be measured by coverage.py, and no - coverage modules will be mentioned in the nose --with-cover plug-in. Fixed - `issue 8`. - -- When running source files, coverage.py now opens them in universal newline - mode just like Python does. This lets it run Windows files on Mac, for - example. - -.. _issue 9: http://bitbucket.org/ned/coveragepy/issue/9 -.. _issue 10: http://bitbucket.org/ned/coveragepy/issue/10 -.. _issue 8: http://bitbucket.org/ned/coveragepy/issue/8 - - -Version 3.0, 13 June 2009 -------------------------- - -- Fixed the way the Python library was ignored. Too much code was being - excluded the old way. - -- Tabs are now properly converted in HTML reports. Previously indentation was - lost. Fixed `issue 6`. - -- Nested modules now get a proper flat_rootname. Thanks, Christian Heimes. - -.. _issue 6: http://bitbucket.org/ned/coveragepy/issue/6 - - -Version 3.0b3, 16 May 2009 --------------------------- - -- Added parameters to coverage.__init__ for options that had been set on the - coverage object itself. - -- Added clear_exclude() and get_exclude_list() methods for programmatic - manipulation of the exclude regexes. - -- Added coverage.load() to read previously-saved data from the data file. - -- Improved the finding of code files. For example, .pyc files that have been - installed after compiling are now located correctly. Thanks, Detlev - Offenbach. - -- When using the object API (that is, constructing a coverage() object), data - is no longer saved automatically on process exit. You can re-enable it with - the auto_data=True parameter on the coverage() constructor. The module-level - interface still uses automatic saving. - - -Version 3.0b2, 30 April 2009 ----------------------------- - -HTML reporting, and continued refactoring. - -- HTML reports and annotation of source files: use the new -b (browser) switch. - Thanks to George Song for code, inspiration and guidance. - -- Code in the Python standard library is not measured by default. If you need - to measure standard library code, use the -L command-line switch during - execution, or the cover_pylib=True argument to the coverage() constructor. - -- Source annotation into a directory (-a -d) behaves differently. The - annotated files are named with their hierarchy flattened so that same-named - files from different directories no longer collide. Also, only files in the - current tree are included. - -- coverage.annotate_file is no longer available. - -- Programs executed with -x now behave more as they should, for example, - __file__ has the correct value. - -- .coverage data files have a new pickle-based format designed for better - extensibility. - -- Removed the undocumented cache_file argument to coverage.usecache(). - - -Version 3.0b1, 7 March 2009 ---------------------------- - -Major overhaul. - -- Coverage is now a package rather than a module. Functionality has been split - into classes. - -- The trace function is implemented in C for speed. Coverage runs are now - much faster. Thanks to David Christian for productive micro-sprints and - other encouragement. - -- Executable lines are identified by reading the line number tables in the - compiled code, removing a great deal of complicated analysis code. - -- Precisely which lines are considered executable has changed in some cases. - Therefore, your coverage stats may also change slightly. - -- The singleton coverage object is only created if the module-level functions - are used. This maintains the old interface while allowing better - programmatic use of Coverage. - -- The minimum supported Python version is 2.3. - - -Version 2.85, 14 September 2008 -------------------------------- - -- Add support for finding source files in eggs. Don't check for - morf's being instances of ModuleType, instead use duck typing so that - pseudo-modules can participate. Thanks, Imri Goldberg. - -- Use os.realpath as part of the fixing of file names so that symlinks won't - confuse things. Thanks, Patrick Mezard. - - -Version 2.80, 25 May 2008 -------------------------- - -- Open files in rU mode to avoid line ending craziness. Thanks, Edward Loper. - - -Version 2.78, 30 September 2007 -------------------------------- - -- Don't try to predict whether a file is Python source based on the extension. - Extension-less files are often Pythons scripts. Instead, simply parse the file - and catch the syntax errors. Hat tip to Ben Finney. - - -Version 2.77, 29 July 2007 --------------------------- - -- Better packaging. - - -Version 2.76, 23 July 2007 --------------------------- - -- Now Python 2.5 is *really* fully supported: the body of the new with - statement is counted as executable. - - -Version 2.75, 22 July 2007 --------------------------- - -- Python 2.5 now fully supported. The method of dealing with multi-line - statements is now less sensitive to the exact line that Python reports during - execution. Pass statements are handled specially so that their disappearance - during execution won't throw off the measurement. - - -Version 2.7, 21 July 2007 -------------------------- - -- "#pragma: nocover" is excluded by default. - -- Properly ignore docstrings and other constant expressions that appear in the - middle of a function, a problem reported by Tim Leslie. - -- coverage.erase() shouldn't clobber the exclude regex. Change how parallel - mode is invoked, and fix erase() so that it erases the cache when called - programmatically. - -- In reports, ignore code executed from strings, since we can't do anything - useful with it anyway. - -- Better file handling on Linux, thanks Guillaume Chazarain. - -- Better shell support on Windows, thanks Noel O'Boyle. - -- Python 2.2 support maintained, thanks Catherine Proulx. - -- Minor changes to avoid lint warnings. - - -Version 2.6, 23 August 2006 ---------------------------- - -- Applied Joseph Tate's patch for function decorators. - -- Applied Sigve Tjora and Mark van der Wal's fixes for argument handling. - -- Applied Geoff Bache's parallel mode patch. - -- Refactorings to improve testability. Fixes to command-line logic for parallel - mode and collect. - - -Version 2.5, 4 December 2005 ----------------------------- - -- Call threading.settrace so that all threads are measured. Thanks Martin - Fuzzey. - -- Add a file argument to report so that reports can be captured to a different - destination. - -- coverage.py can now measure itself. - -- Adapted Greg Rogers' patch for using relative file names, and sorting and - omitting files to report on. - - -Version 2.2, 31 December 2004 ------------------------------ - -- Allow for keyword arguments in the module global functions. Thanks, Allen. - - -Version 2.1, 14 December 2004 ------------------------------ - -- Return 'analysis' to its original behavior and add 'analysis2'. Add a global - for 'annotate', and factor it, adding 'annotate_file'. - - -Version 2.0, 12 December 2004 ------------------------------ - -Significant code changes. - -- Finding executable statements has been rewritten so that docstrings and - other quirks of Python execution aren't mistakenly identified as missing - lines. - -- Lines can be excluded from consideration, even entire suites of lines. - -- The file system cache of covered lines can be disabled programmatically. - -- Modernized the code. - - -Earlier History ---------------- - -2001-12-04 GDR Created. - -2001-12-06 GDR Added command-line interface and source code annotation. - -2001-12-09 GDR Moved design and interface to separate documents. - -2001-12-10 GDR Open cache file as binary on Windows. Allow simultaneous -e and --x, or -a and -r. - -2001-12-12 GDR Added command-line help. Cache analysis so that it only needs to -be done once when you specify -a and -r. - -2001-12-13 GDR Improved speed while recording. Portable between Python 1.5.2 -and 2.1.1. - -2002-01-03 GDR Module-level functions work correctly. - -2002-01-07 GDR Update sys.path when running a file with the -x option, so that -it matches the value the program would get if it were run on its own. +------------------------------ +Change history for Coverage.py +------------------------------ + + +Version 3.3 +----------- + +- Settings are now read from a .coveragerc file. + + +Version 3.2, 5 December 2009 +---------------------------- + +- Added a --version options on the command line. + + +Version 3.2b4, 1 December 2009 +------------------------------ + +- Branch coverage improvements: + + - The XML report now includes branch information. + +- Click-to-sort HTML report columns are now persisted in a cookie. Viewing + a report will sort it first the way you last had a coverage report sorted. + Thanks, `Chris Adams`_. + +- On Python 3.x, setuptools has been replaced by `Distribute`_. + +.. _Distribute: http://packages.python.org/distribute/ + + +Version 3.2b3, 23 November 2009 +------------------------------- + +- Fixed a memory leak in the C tracer that was introduced in 3.2b1. + +- Branch coverage improvements: + + - Branches to excluded code are ignored. + +- The table of contents in the HTML report is now sortable: click the headers + on any column. Thanks, `Chris Adams`_. + +.. _Chris Adams: http://improbable.org/chris/ + + +Version 3.2b2, 19 November 2009 +------------------------------- + +- Branch coverage improvements: + + - Classes are no longer incorrectly marked as branches: `issue 32`_. + + - "except" clauses with types are no longer incorrectly marked as branches: + `issue 35`_. + +- Fixed some problems syntax coloring sources with line continuations and + source with tabs: `issue 30`_ and `issue 31`_. + +- The --omit option now works much better than before, fixing `issue 14` and + `issue 33`_. Thanks, Danek Duvall. + +.. _issue 14: http://bitbucket.org/ned/coveragepy/issue/14 +.. _issue 30: http://bitbucket.org/ned/coveragepy/issue/30 +.. _issue 31: http://bitbucket.org/ned/coveragepy/issue/31 +.. _issue 32: http://bitbucket.org/ned/coveragepy/issue/32 +.. _issue 33: http://bitbucket.org/ned/coveragepy/issue/33 +.. _issue 35: http://bitbucket.org/ned/coveragepy/issue/35 + + +Version 3.2b1, 10 November 2009 +------------------------------- + +- Branch coverage! + +- XML reporting has file paths that let Cobertura find the source code. + +- The tracer code has changed, it's a few percent faster. + +- Some exceptions reported by the command line interface have been cleaned up + so that tracebacks inside coverage.py aren't shown. Fixes `issue 23`_. + +.. _issue 23: http://bitbucket.org/ned/coveragepy/issue/23 + + +Version 3.1, 4 October 2009 +--------------------------- + +- Source code can now be read from eggs. Thanks, Ross Lawley. Fixes + `issue 25`_. + +.. _issue 25: http://bitbucket.org/ned/coveragepy/issue/25 + + +Version 3.1b1, 27 September 2009 +-------------------------------- + +- Python 3.1 is now supported. + +- Coverage.py has a new command line syntax with sub-commands. This expands + the possibilities for adding features and options in the future. The old + syntax is still supported. Try "coverage help" to see the new commands. + Thanks to Ben Finney for early help. + +- Added an experimental "coverage xml" command for producing coverage reports + in a Cobertura-compatible XML format. Thanks, Bill Hart. + +- Added the --timid option to enable a simpler slower trace function that works + for DecoratorTools projects, including TurboGears. Fixed `issue 12`_ and + `issue 13`_. + +- HTML reports show modules from other directories. Fixed `issue 11`_. + +- HTML reports now display syntax-colored Python source. + +- Programs that change directory will still write .coverage files in the + directory where execution started. Fixed `issue 24`_. + +- Added a "coverage debug" command for getting diagnostic information about the + coverage.py installation. + +.. _issue 11: http://bitbucket.org/ned/coveragepy/issue/11 +.. _issue 12: http://bitbucket.org/ned/coveragepy/issue/12 +.. _issue 13: http://bitbucket.org/ned/coveragepy/issue/13 +.. _issue 24: http://bitbucket.org/ned/coveragepy/issue/24 + + +Version 3.0.1, 7 July 2009 +-------------------------- + +- Removed the recursion limit in the tracer function. Previously, code that + ran more than 500 frames deep would crash. Fixed `issue 9`. + +- Fixed a bizarre problem involving pyexpat, whereby lines following XML parser + invocations could be overlooked. Fixed `issue 10`. + +- On Python 2.3, coverage.py could mis-measure code with exceptions being + raised. This is now fixed. + +- The coverage.py code itself will now not be measured by coverage.py, and no + coverage modules will be mentioned in the nose --with-cover plug-in. Fixed + `issue 8`. + +- When running source files, coverage.py now opens them in universal newline + mode just like Python does. This lets it run Windows files on Mac, for + example. + +.. _issue 9: http://bitbucket.org/ned/coveragepy/issue/9 +.. _issue 10: http://bitbucket.org/ned/coveragepy/issue/10 +.. _issue 8: http://bitbucket.org/ned/coveragepy/issue/8 + + +Version 3.0, 13 June 2009 +------------------------- + +- Fixed the way the Python library was ignored. Too much code was being + excluded the old way. + +- Tabs are now properly converted in HTML reports. Previously indentation was + lost. Fixed `issue 6`. + +- Nested modules now get a proper flat_rootname. Thanks, Christian Heimes. + +.. _issue 6: http://bitbucket.org/ned/coveragepy/issue/6 + + +Version 3.0b3, 16 May 2009 +-------------------------- + +- Added parameters to coverage.__init__ for options that had been set on the + coverage object itself. + +- Added clear_exclude() and get_exclude_list() methods for programmatic + manipulation of the exclude regexes. + +- Added coverage.load() to read previously-saved data from the data file. + +- Improved the finding of code files. For example, .pyc files that have been + installed after compiling are now located correctly. Thanks, Detlev + Offenbach. + +- When using the object API (that is, constructing a coverage() object), data + is no longer saved automatically on process exit. You can re-enable it with + the auto_data=True parameter on the coverage() constructor. The module-level + interface still uses automatic saving. + + +Version 3.0b2, 30 April 2009 +---------------------------- + +HTML reporting, and continued refactoring. + +- HTML reports and annotation of source files: use the new -b (browser) switch. + Thanks to George Song for code, inspiration and guidance. + +- Code in the Python standard library is not measured by default. If you need + to measure standard library code, use the -L command-line switch during + execution, or the cover_pylib=True argument to the coverage() constructor. + +- Source annotation into a directory (-a -d) behaves differently. The + annotated files are named with their hierarchy flattened so that same-named + files from different directories no longer collide. Also, only files in the + current tree are included. + +- coverage.annotate_file is no longer available. + +- Programs executed with -x now behave more as they should, for example, + __file__ has the correct value. + +- .coverage data files have a new pickle-based format designed for better + extensibility. + +- Removed the undocumented cache_file argument to coverage.usecache(). + + +Version 3.0b1, 7 March 2009 +--------------------------- + +Major overhaul. + +- Coverage is now a package rather than a module. Functionality has been split + into classes. + +- The trace function is implemented in C for speed. Coverage runs are now + much faster. Thanks to David Christian for productive micro-sprints and + other encouragement. + +- Executable lines are identified by reading the line number tables in the + compiled code, removing a great deal of complicated analysis code. + +- Precisely which lines are considered executable has changed in some cases. + Therefore, your coverage stats may also change slightly. + +- The singleton coverage object is only created if the module-level functions + are used. This maintains the old interface while allowing better + programmatic use of Coverage. + +- The minimum supported Python version is 2.3. + + +Version 2.85, 14 September 2008 +------------------------------- + +- Add support for finding source files in eggs. Don't check for + morf's being instances of ModuleType, instead use duck typing so that + pseudo-modules can participate. Thanks, Imri Goldberg. + +- Use os.realpath as part of the fixing of file names so that symlinks won't + confuse things. Thanks, Patrick Mezard. + + +Version 2.80, 25 May 2008 +------------------------- + +- Open files in rU mode to avoid line ending craziness. Thanks, Edward Loper. + + +Version 2.78, 30 September 2007 +------------------------------- + +- Don't try to predict whether a file is Python source based on the extension. + Extension-less files are often Pythons scripts. Instead, simply parse the file + and catch the syntax errors. Hat tip to Ben Finney. + + +Version 2.77, 29 July 2007 +-------------------------- + +- Better packaging. + + +Version 2.76, 23 July 2007 +-------------------------- + +- Now Python 2.5 is *really* fully supported: the body of the new with + statement is counted as executable. + + +Version 2.75, 22 July 2007 +-------------------------- + +- Python 2.5 now fully supported. The method of dealing with multi-line + statements is now less sensitive to the exact line that Python reports during + execution. Pass statements are handled specially so that their disappearance + during execution won't throw off the measurement. + + +Version 2.7, 21 July 2007 +------------------------- + +- "#pragma: nocover" is excluded by default. + +- Properly ignore docstrings and other constant expressions that appear in the + middle of a function, a problem reported by Tim Leslie. + +- coverage.erase() shouldn't clobber the exclude regex. Change how parallel + mode is invoked, and fix erase() so that it erases the cache when called + programmatically. + +- In reports, ignore code executed from strings, since we can't do anything + useful with it anyway. + +- Better file handling on Linux, thanks Guillaume Chazarain. + +- Better shell support on Windows, thanks Noel O'Boyle. + +- Python 2.2 support maintained, thanks Catherine Proulx. + +- Minor changes to avoid lint warnings. + + +Version 2.6, 23 August 2006 +--------------------------- + +- Applied Joseph Tate's patch for function decorators. + +- Applied Sigve Tjora and Mark van der Wal's fixes for argument handling. + +- Applied Geoff Bache's parallel mode patch. + +- Refactorings to improve testability. Fixes to command-line logic for parallel + mode and collect. + + +Version 2.5, 4 December 2005 +---------------------------- + +- Call threading.settrace so that all threads are measured. Thanks Martin + Fuzzey. + +- Add a file argument to report so that reports can be captured to a different + destination. + +- coverage.py can now measure itself. + +- Adapted Greg Rogers' patch for using relative file names, and sorting and + omitting files to report on. + + +Version 2.2, 31 December 2004 +----------------------------- + +- Allow for keyword arguments in the module global functions. Thanks, Allen. + + +Version 2.1, 14 December 2004 +----------------------------- + +- Return 'analysis' to its original behavior and add 'analysis2'. Add a global + for 'annotate', and factor it, adding 'annotate_file'. + + +Version 2.0, 12 December 2004 +----------------------------- + +Significant code changes. + +- Finding executable statements has been rewritten so that docstrings and + other quirks of Python execution aren't mistakenly identified as missing + lines. + +- Lines can be excluded from consideration, even entire suites of lines. + +- The file system cache of covered lines can be disabled programmatically. + +- Modernized the code. + + +Earlier History +--------------- + +2001-12-04 GDR Created. + +2001-12-06 GDR Added command-line interface and source code annotation. + +2001-12-09 GDR Moved design and interface to separate documents. + +2001-12-10 GDR Open cache file as binary on Windows. Allow simultaneous -e and +-x, or -a and -r. + +2001-12-12 GDR Added command-line help. Cache analysis so that it only needs to +be done once when you specify -a and -r. + +2001-12-13 GDR Improved speed while recording. Portable between Python 1.5.2 +and 2.1.1. + +2002-01-03 GDR Module-level functions work correctly. + +2002-01-07 GDR Update sys.path when running a file with the -x option, so that +it matches the value the program would get if it were run on its own. diff --git a/README.txt b/README.txt index 1dbbf5a8..2c6fe3d6 100644 --- a/README.txt +++ b/README.txt @@ -1,9 +1,9 @@ -Coverage.py: code coverage testing for Python - -Coverage.py measures code coverage, typically during test execution. It uses -the code analysis tools and tracing hooks provided in the Python standard -library to determine which lines are executable, and which have been executed. - -For more information, see http://nedbatchelder.com/code/coverage - -Code repo and issue tracking are at http://bitbucket.org/ned/coveragepy +Coverage.py: code coverage testing for Python + +Coverage.py measures code coverage, typically during test execution. It uses +the code analysis tools and tracing hooks provided in the Python standard +library to determine which lines are executable, and which have been executed. + +For more information, see http://nedbatchelder.com/code/coverage + +Code repo and issue tracking are at http://bitbucket.org/ned/coveragepy diff --git a/TODO.txt b/TODO.txt index 59eda589..4069c936 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,211 +1,211 @@ -Coverage TODO - -* 3.3 - -- Config file - - A command switch to point to the rc file. - - Write docs -- Better omit handling that ignores files during measurement. - - Deal with ~ in specified paths correctly. -- while TRUE claims to be partial. - - A way to mark lines as partial branches, with a regex? - - Default to "while True:", "while 1:" -- HTML keyboard short cuts - - -* 3.2 - -+ Some kind of indication in the HTML where yellow lines aren't going. -- Profile the reporting code: it's REALLY slow. - - parser is doing some redundant work. -+ Analysis class should do rolling up of stats also (actually Numbers) -+ Update docs for --branch. -- self.coverage.data.has_arcs is ugly. -+ Branches that never jump to nocover lines shouldn't be marked as partial. - (see top of test_cogapp for examples) -+ Maybe turning off yellow lines should make those lines green? -+ A missing branch to leave the function shows an annotation of -1. Now "exit". -+ XML report needs to get branch information. -+ Add branch info to "coverage debug data" -+ Polish up the help, and double-check the docs. - - - -* Speed - -+ C extension collector -- bitvector in trace extension. -- Ignore certain modules -+ Record linenos rather than (file,lineno) pairs in tracer. -x Tricky swapping of collector like figleaf, pycov, et al. (Don't need to do - this with C collector). -- Seems like there should be a faster way to manage all the line number sets in - CodeParser.raw_parse. -- If tracing, canonical_filename_cache overlaps with should_trace_cache. Skip - canonical_filename_cache. Maybe it isn't even worth it... -- Would pre-allocating line number integers make the C tracer faster? It would - use less memory. - - -* Accuracy - -- Record magic number of module to ensure code hasn't changed -- Record version of coverage data file, so we can update what's stored there. -- Record options in coverage data file, so multiple runs are certain to make - sense together. -- Do I still need the lines in annotate_file that deal specially with "else"? - - -* Power - -+ Branch coverage - Titus' idea: - 1: if a: - 2: b = 2 - 3: c = 3 - if the coverage data shows 1,2,3, it was if-then. if it's 1,3, then the - missing else was executed. -- API for getting coverage data. -- Instruction tracing instead of line tracing. -- Path tracing (how does this even work?) -- Count execution of lines -- Track callers of functions (ala std module trace) -- Method/Class/Module coverage reporting. -- .coverage files that can be kept separate, rather than accumulated. -- test/coverage map: http://rbtcollins.wordpress.com/2009/09/16/back-from-hiatus/ - - Similar to figleaf's sections. - - -* Convenience - -- Command line modules should also be directories, meaning all the modules in that - directory. -- Why can't a morf also be a string, the name of a module? -- ignore by module as well as file? -- Use a .coveragerc file to control Coverage without the programmatic API. -- Own the nose --with-cover plugin. -x Why can't you specify execute (-x) and report (-r) in the same invocation? - Maybe just because -x needs the rest of the command line? -+ Support 2.3 - 3.1! - http://pythonology.blogspot.com/2009/02/making-code-run-on-python-20-through-30.html - http://www.rfk.id.au/blog/entry/preparing-pyenchant-for-python-3 - http://pydev.blogspot.com/2008/11/making-code-work-in-python-2-and-3.html - + Explicitly set pickle protocol to 2. -- An inference mode that marks lines as executed if they "must have been" executed: - class definitions, etc, when coverage is started after the class is defined. -- Different categories of exclude pragma? So you can enable and disable them - from the command line, to reconsider exclusions. -- Reporting on files never touched by coverage (package completeness) - - -* Beauty - -+ HTML report - - Colored bars indicating coverage per file. - - Package navigation. - - Rolled-up statistics. - - Some way to focus in on red and yellow - - Show only lines near highlights? - - Jump to next highlight? - - Keyboard navigation: N and P - - Cookie for changes to pyfile.html state. - + Clickable column headers on the index page. - + Syntax coloring in HTML report. - + Dynamic effects in HTML report. - + Footer in reports pointing to coverage home page. - + Baseline grid for linenumber font. - + Separate out css and HTML. - - Does it work right with utf-8 source files? http://www.python.org/dev/peps/pep-0263/ - - -* Community - -+ New docs, rather than pointing to Gareth's - + Min python version is 2.3. - - Three phases of work: - - Collection - - Analysis - - Reporting - - Distinction between: - - ignore (files not to collect) - - exclude (lines not to report as missed) - - omit (files not to report) - - Changes from coverage 2.x: - - Bare "except:" lines now count as executable code. - - Double function decorators: all decorator lines count as executable code. - - Document the .coverage file format. - + HTML reporting. - - Much more detail about what's in the report. - - References between pages are off: - - They have tags around them. - - They use #anchors that don't survive the px->html conversion. -+ Be sure --help text is complete (-i is missing). -+ Host the project somewhere with a real bug tracker: bitbucket.org -+ Point discussion to TIP -- PEP 8 compliance? - - -* Programmability - -+ Don't use sys.exit in CoverageScript. -+ Remove singleton - + Initialization of instance variables in the class. - - -* Installation - -- How will Coverage package install over coverage.py module? -- pip can't install it: it reads the coverage html page, and finds the kit link, - but then can't handle the root-relative link. - - -* Modernization - -+ Decide on minimum supported version - + 2.3 - + Get rid of the basestring protection - + Use enumerate - + Use sets instead of dicts -+ Switch from getopt to optparse. -+ Get rid of the recursive nonsense. -+ Docstrings. -+ Remove huge document-style comments. -- Better names: - + self.cache -> self.cache_filename -> CoverageData.filename - + self.usecache -> CoverageData.use_file -- More classes: - - Module munging - + Coverage data files -+ Why are some imports at the top of the file, and some in functions? -+ Get rid of sys.exitfunc use. -+ True and False (with no backward adaptation: the constants are new in 2.2.1) -+ Get rid of compiler module - + In analyzing code - + In test_coverage.py -+ Style: - + lineno - + filename - - -* Correctness - -- What does -p (parallel mode) mean with -e (erase data)? - - -* Tests - -+ Switch to a real test runner, like nose. -+ Test both the C trace function and the Python trace function. -+ parser.py has no direct tests. -- Tests about the .coverage file. -+ Tests about the --long-form of arguments. -+ Tests about overriding the .coverage filename. -- Tests about parallel mode. -+ Tests about assigning a multi-line string. -- Tests about tricky docstrings. -+ Coverage test Coverage! -- Tests that tracing stops after calling stop() -- More intensive thread testing. -x Tests about the "import __main__" in cmdline.py -- What happens if the -x script raises an exception? -- Test that the kit has all the proper contents. +Coverage TODO + +* 3.3 + +- Config file + - A command switch to point to the rc file. + - Write docs +- Better omit handling that ignores files during measurement. + - Deal with ~ in specified paths correctly. +- while TRUE claims to be partial. + - A way to mark lines as partial branches, with a regex? + - Default to "while True:", "while 1:" +- HTML keyboard short cuts + + +* 3.2 + ++ Some kind of indication in the HTML where yellow lines aren't going. +- Profile the reporting code: it's REALLY slow. + - parser is doing some redundant work. ++ Analysis class should do rolling up of stats also (actually Numbers) ++ Update docs for --branch. +- self.coverage.data.has_arcs is ugly. ++ Branches that never jump to nocover lines shouldn't be marked as partial. + (see top of test_cogapp for examples) ++ Maybe turning off yellow lines should make those lines green? ++ A missing branch to leave the function shows an annotation of -1. Now "exit". ++ XML report needs to get branch information. ++ Add branch info to "coverage debug data" ++ Polish up the help, and double-check the docs. + + + +* Speed + ++ C extension collector +- bitvector in trace extension. +- Ignore certain modules ++ Record linenos rather than (file,lineno) pairs in tracer. +x Tricky swapping of collector like figleaf, pycov, et al. (Don't need to do + this with C collector). +- Seems like there should be a faster way to manage all the line number sets in + CodeParser.raw_parse. +- If tracing, canonical_filename_cache overlaps with should_trace_cache. Skip + canonical_filename_cache. Maybe it isn't even worth it... +- Would pre-allocating line number integers make the C tracer faster? It would + use less memory. + + +* Accuracy + +- Record magic number of module to ensure code hasn't changed +- Record version of coverage data file, so we can update what's stored there. +- Record options in coverage data file, so multiple runs are certain to make + sense together. +- Do I still need the lines in annotate_file that deal specially with "else"? + + +* Power + ++ Branch coverage + Titus' idea: + 1: if a: + 2: b = 2 + 3: c = 3 + if the coverage data shows 1,2,3, it was if-then. if it's 1,3, then the + missing else was executed. +- API for getting coverage data. +- Instruction tracing instead of line tracing. +- Path tracing (how does this even work?) +- Count execution of lines +- Track callers of functions (ala std module trace) +- Method/Class/Module coverage reporting. +- .coverage files that can be kept separate, rather than accumulated. +- test/coverage map: http://rbtcollins.wordpress.com/2009/09/16/back-from-hiatus/ + - Similar to figleaf's sections. + + +* Convenience + +- Command line modules should also be directories, meaning all the modules in that + directory. +- Why can't a morf also be a string, the name of a module? +- ignore by module as well as file? +- Use a .coveragerc file to control Coverage without the programmatic API. +- Own the nose --with-cover plugin. +x Why can't you specify execute (-x) and report (-r) in the same invocation? + Maybe just because -x needs the rest of the command line? ++ Support 2.3 - 3.1! + http://pythonology.blogspot.com/2009/02/making-code-run-on-python-20-through-30.html + http://www.rfk.id.au/blog/entry/preparing-pyenchant-for-python-3 + http://pydev.blogspot.com/2008/11/making-code-work-in-python-2-and-3.html + + Explicitly set pickle protocol to 2. +- An inference mode that marks lines as executed if they "must have been" executed: + class definitions, etc, when coverage is started after the class is defined. +- Different categories of exclude pragma? So you can enable and disable them + from the command line, to reconsider exclusions. +- Reporting on files never touched by coverage (package completeness) + + +* Beauty + ++ HTML report + - Colored bars indicating coverage per file. + - Package navigation. + - Rolled-up statistics. + - Some way to focus in on red and yellow + - Show only lines near highlights? + - Jump to next highlight? + - Keyboard navigation: N and P + - Cookie for changes to pyfile.html state. + + Clickable column headers on the index page. + + Syntax coloring in HTML report. + + Dynamic effects in HTML report. + + Footer in reports pointing to coverage home page. + + Baseline grid for linenumber font. + + Separate out css and HTML. + - Does it work right with utf-8 source files? http://www.python.org/dev/peps/pep-0263/ + + +* Community + ++ New docs, rather than pointing to Gareth's + + Min python version is 2.3. + - Three phases of work: + - Collection + - Analysis + - Reporting + - Distinction between: + - ignore (files not to collect) + - exclude (lines not to report as missed) + - omit (files not to report) + - Changes from coverage 2.x: + - Bare "except:" lines now count as executable code. + - Double function decorators: all decorator lines count as executable code. + - Document the .coverage file format. + + HTML reporting. + - Much more detail about what's in the report. + - References between pages are off: + - They have tags around them. + - They use #anchors that don't survive the px->html conversion. ++ Be sure --help text is complete (-i is missing). ++ Host the project somewhere with a real bug tracker: bitbucket.org ++ Point discussion to TIP +- PEP 8 compliance? + + +* Programmability + ++ Don't use sys.exit in CoverageScript. ++ Remove singleton + + Initialization of instance variables in the class. + + +* Installation + +- How will Coverage package install over coverage.py module? +- pip can't install it: it reads the coverage html page, and finds the kit link, + but then can't handle the root-relative link. + + +* Modernization + ++ Decide on minimum supported version + + 2.3 + + Get rid of the basestring protection + + Use enumerate + + Use sets instead of dicts ++ Switch from getopt to optparse. ++ Get rid of the recursive nonsense. ++ Docstrings. ++ Remove huge document-style comments. +- Better names: + + self.cache -> self.cache_filename -> CoverageData.filename + + self.usecache -> CoverageData.use_file +- More classes: + - Module munging + + Coverage data files ++ Why are some imports at the top of the file, and some in functions? ++ Get rid of sys.exitfunc use. ++ True and False (with no backward adaptation: the constants are new in 2.2.1) ++ Get rid of compiler module + + In analyzing code + + In test_coverage.py ++ Style: + + lineno + + filename + + +* Correctness + +- What does -p (parallel mode) mean with -e (erase data)? + + +* Tests + ++ Switch to a real test runner, like nose. ++ Test both the C trace function and the Python trace function. ++ parser.py has no direct tests. +- Tests about the .coverage file. ++ Tests about the --long-form of arguments. ++ Tests about overriding the .coverage filename. +- Tests about parallel mode. ++ Tests about assigning a multi-line string. +- Tests about tricky docstrings. ++ Coverage test Coverage! +- Tests that tracing stops after calling stop() +- More intensive thread testing. +x Tests about the "import __main__" in cmdline.py +- What happens if the -x script raises an exception? +- Test that the kit has all the proper contents. diff --git a/doc/sample_html/README.txt b/doc/sample_html/README.txt index 2890fb94..2d3cd4ab 100644 --- a/doc/sample_html/README.txt +++ b/doc/sample_html/README.txt @@ -1,5 +1,5 @@ -This directory was made with:: - - cd C:\ned\cog\trunk - coverage run --branch cogapp\test_cogapp.py CogTestsInMemory - coverage html -i -d htmlcov +This directory was made with:: + + cd C:\ned\cog\trunk + coverage run --branch cogapp\test_cogapp.py CogTestsInMemory + coverage html -i -d htmlcov diff --git a/lab/cmd-opts.txt b/lab/cmd-opts.txt index 87fd1e23..5b749918 100644 --- a/lab/cmd-opts.txt +++ b/lab/cmd-opts.txt @@ -10,23 +10,23 @@ commands: --timid bool -p --parallel bool -L --stdlib bool - --branch bool * + --branch bool -a --append bool erase -e - + combine -c - - report -r + + report -r -m --missing bool -i --ignore-errors bool --omit list of string - + annotate -a -d --output-directory string -i --ignore-errors bool --omit list of string - + html -b -d --output-directory string -i --ignore-errors bool @@ -38,11 +38,11 @@ commands: help byteprep * - + xml * - - - + + + Option scopes: - Cmd line diff --git a/lab/dataflow.txt b/lab/dataflow.txt index 9ae891db..57962064 100644 --- a/lab/dataflow.txt +++ b/lab/dataflow.txt @@ -1,7 +1,7 @@ PyTracer.data: { filename: { lineno: None, .. }, ... } OR: { filename: { (l1, l2): None, .. }, ... } - + CoverageData.lines: { filename: { lineno: None, ...}, ... } @@ -20,7 +20,7 @@ CoverageData.executed_files(): called by: Reporter.find_code_units() tests - + CoverageData.executed_lines(): returns { lineno: None, ... } called by: diff --git a/test/backtest.py b/test/backtest.py index 63ee5194..4460a78d 100644 --- a/test/backtest.py +++ b/test/backtest.py @@ -4,7 +4,7 @@ # (Redefining built-in blah) # The whole point of this file is to redefine built-ins, so shut up about it. -import os, sys +import os # Py2k and 3k don't agree on how to run commands in a subprocess. try: diff --git a/test/coveragetest.py b/test/coveragetest.py index fb6a5bcc..603c685c 100644 --- a/test/coveragetest.py +++ b/test/coveragetest.py @@ -38,7 +38,7 @@ class CoverageTest(TestCase): self.old_dir = os.getcwd() os.chdir(self.temp_dir) - + # Modules should be importable from this temp directory. self.old_syspath = sys.path[:] sys.path.insert(0, '') @@ -48,7 +48,7 @@ class CoverageTest(TestCase): # Record environment variables that we changed with set_environ. self.environ_undos = {} - + # Use a Tee to capture stdout. self.old_stdout = sys.stdout self.captured_stdout = StringIO() @@ -71,15 +71,15 @@ class CoverageTest(TestCase): def set_environ(self, name, value): """Set an environment variable `name` to be `value`. - + The environment variable is set, and record is kept that it was set, so that `tearDown` can restore its original value. - + """ if name not in self.environ_undos: self.environ_undos[name] = os.environ.get(name) os.environ[name] = value - + def original_environ(self, name): """The environment variable `name` from when the test started.""" if name in self.environ_undos: diff --git a/test/farm/annotate/run_multi.py b/test/farm/annotate/run_multi.py index 872f0976..4e8252ed 100644 --- a/test/farm/annotate/run_multi.py +++ b/test/farm/annotate/run_multi.py @@ -1,7 +1,7 @@ copy("src", "out_multi") run(""" coverage -e -x multi.py - coverage -a + coverage -a """, rundir="out_multi") compare("out_multi", "gold_multi", "*,cover") clean("out_multi") diff --git a/test/farm/html/run_tabbed.py b/test/farm/html/run_tabbed.py index f28e0c37..3076b4e5 100644 --- a/test/farm/html/run_tabbed.py +++ b/test/farm/html/run_tabbed.py @@ -17,7 +17,7 @@ contains("html_tabbed/tabbed.html", "x:" "                    " "               " - "# look nice" + "# look nice" ) doesnt_contain("html_tabbed/tabbed.html", "\t") diff --git a/test/farm/html/src/b.py b/test/farm/html/src/b.py index f5d051c6..dffdd50f 100644 --- a/test/farm/html/src/b.py +++ b/test/farm/html/src/b.py @@ -13,7 +13,7 @@ def two(x): # A missed else that branches to "exit" if x: a = 5 - + two(1) def three_way(): diff --git a/test/farm/html/src/tabbed.py b/test/farm/html/src/tabbed.py index bc6bb456..4c39cafe 100644 --- a/test/farm/html/src/tabbed.py +++ b/test/farm/html/src/tabbed.py @@ -3,6 +3,6 @@ x = 1 if x: a = "Tabbed" # Aligned comments if x: # look nice - b = "No spaces" # when they + b = "No spaces" # when they c = "Done" # line up. diff --git a/test/stress_phystoken.txt b/test/stress_phystoken.txt index 7e2f2858..1206c4ac 100644 --- a/test/stress_phystoken.txt +++ b/test/stress_phystoken.txt @@ -15,6 +15,7 @@ lots_of_back = """\ hey \ there """ +# This next line is supposed to have trailing whitespace: fake_back = """\ ouch """ -- cgit v1.2.1