summaryrefslogtreecommitdiff
path: root/coverage/pytracer.py
Commit message (Collapse)AuthorAgeFilesLines
* style: double quotesNed Batchelder2023-03-221-10/+10
|
* fix: add safety for empty stack on shutdown. (#1543)Russell Keith-Magee2023-02-031-3/+11
| | | | | | | | | * Add safety for empty stack on shutdown. * Correct line length linting issue. --------- Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* mypy: pytracer.py, the last file in coverage/Ned Batchelder2023-01-121-23/+36
|
* mypy: use __future__ uniformly in checked filesNed Batchelder2023-01-051-0/+2
|
* mypy: partial debug.py and pytracer.pyNed Batchelder2023-01-021-10/+12
|
* mypy: check collector.py and plugin_support.pyNed Batchelder2023-01-011-20/+26
|
* docs: mentioned pull #1388Ned Batchelder2022-05-301-4/+3
|
* perf: PyTracer improvements (#1388)Carl Friedrich Bolz-Tereick2022-05-301-24/+41
| | | | | | | | | | | | | | | | | * cache the bound method of _trace on self this speeds up pure python tracing because we don't have to re-create a bound method object all the time * optimize checking whether a file should be traced the optimization works based on the following heuristic: in a majority of cases, functions call other functions in the same file. In that situation we don't have to re-check whether we should trace the file * fix optimization in the presence of contexts * fix too long line
* perf: set frame->f_trace_lines=0 when not tracing. ~3% fasterNed Batchelder2022-05-281-0/+4
|
* perf: speed up python tracer with frame.f_trace_lines = False (#1381)Carl Friedrich Bolz-Tereick2022-05-281-0/+2
| | | | | | | | | use the python >= 3.7 feature of being able to disable line tracing by setting the frame attribute f_trace_lines to False. This can be used for the frames of functions that we aren't collecting coverage information for (eg those functions in the stdlib). This speeds up the pure python tracer in CPython by ~9x and in PyPy by 80% on a coverage run of one realistic project that I tried.
* debug: tweaks to make these clearerNed Batchelder2022-02-061-4/+3
|
* debug: better tracing of pytracer changedNed Batchelder2022-01-301-3/+5
|
* fix: proper tracing of call/return for Python 3.11.0a4Ned Batchelder2022-01-151-7/+16
| | | | | Version 3.11.0a4 introduced RESUME, so returns and calls are different now. This change also fixes some mishandling of yield-from in previous releases.
* fix: update pytracer.py for Python 3.11Ned Batchelder2022-01-151-5/+25
|
* refactor: no need for specialized pyexpat code anymoreNed Batchelder2021-10-181-16/+0
| | | | | | | | The pyexpat bug that plagued us was fixed in Python 3.4: https://bugs.python.org/issue22462 We no longer need the code that adapted to it. The test will remain, couldn't hurt.
* refactor: use sets to collect dataNed Batchelder2021-08-151-15/+15
| | | | | | | Coverage.py predates sets as a built-in data structure, so the file data collection has long been dicts with None as the values. Sets are available to us now (since Python 2.4 in 2004, which coverage.py dropped support for in 2014!), we use sets.
* feat: warnings are now real warningsNed Batchelder2021-05-301-4/+2
| | | | | | This makes coverage warnings visible when running test suites under pytest. But it also means some uninteresting warnings would show up in our own test suite, so we had to catch or suppress those.
* refactor: pyupgrade --py36-plus coverage/*.pyNed Batchelder2021-05-021-2/+2
|
* refactor: remove code explicitly choosing between py2 and py3Ned Batchelder2021-05-011-2/+0
|
* Use current_thread instead of currentThread that was deprecated in Python 3.10Karthikeyan Singaravelan2021-04-171-4/+4
|
* fix: avoid tracing pytracer.pyNed Batchelder2021-02-211-8/+37
| | | | Also, adjust the logging available in pytracer
* Revert "Silence previously unreported pylint warnings"Ned Batchelder2020-12-311-7/+7
| | | | | | | | | | This reverts commit 9169aeadf5cf9e4fc30cd76ef53c0dff2ec946ef. Pylint reports different errors on Mac and Linux! https://github.com/PyCQA/pylint/issues/3489 Put things back to where Mac is a clean report.
* Silence previously unreported pylint warningsNed Batchelder2020-11-291-7/+7
|
* Fix a typoNed Batchelder2019-12-071-1/+1
|
* Python tracer supports dynamic contexts. #846Ned Batchelder2019-09-151-4/+34
|
* No need for format indexes (mostly)Ned Batchelder2019-09-011-1/+1
|
* Use pylint 2.xNed Batchelder2019-05-131-2/+2
|
* Update NOTICE link to GitHub.Ned Batchelder2018-06-241-1/+1
|
* Pylint 1.8.1, and fix its new warningsNed Batchelder2017-12-231-1/+1
|
* Commented-out debugging of pytracerNed Batchelder2017-11-241-4/+25
|
* FIX always remove the callback from the callback itselfOlivier Grisel2017-09-041-7/+12
| | | | | --HG-- branch : fix-thread-safety
* FIX thread-safe Collector.save_data()Olivier Grisel2017-08-101-0/+3
| | | | | --HG-- branch : fix-thread-safety
* Add slugs to warnings in prep for suppressable warningsNed Batchelder2017-04-031-1/+4
|
* Minimal IronPython support.Ned Batchelder2017-03-141-1/+1
| | | | | IronPython is weird: 2.7.7 has "str is unicode", and unicode.encode produces unicode! f_lasti is missing, and frame globals are missing.
* Collecting continues after saving data. #79 #448Ned Batchelder2017-03-031-0/+10
|
* Hmm, not sure why this was a list.Ned Batchelder2017-02-191-1/+1
|
* Jython doesn't have useful co_code or f_lastiNed Batchelder2017-01-131-2/+3
|
* When nesting tracers, don't restart on the wrong threadNed Batchelder2017-01-021-3/+11
|
* The PyPy-specific test for atexit/gettrace are also PyPy-version-specific...Ned Batchelder2016-12-311-1/+1
|
* Don't warn about trace=None on PyPy at shutdownNed Batchelder2016-12-301-3/+12
| | | | | | | | PyPy clears the trace function before calling atexit functions. So when we check if the trace function is changed, don't warn in that specific case. --HG-- extra : amend_source : a4e946f94b9b84d351a9e112a7eea6a3337bacf1
* A thread tweak suggested in #245Ned Batchelder2016-05-071-1/+1
|
* Entry arcs now use the negative first line of the code object instead of -1.Ned Batchelder2016-03-021-2/+5
|
* OMG, sometimes the hardest problems have simple solutions. Now metacoverage ↵Ned Batchelder2015-08-301-0/+1
| | | | works with the Python tracer.
* Too many things named "arcs". Rename the booleans.Ned Batchelder2015-08-081-4/+4
|
* Add license mention to the top of all files. #313.Ned Batchelder2015-07-241-1/+4
|
* Fix branch coverage for yield statements. #308 #324Ned Batchelder2015-04-201-5/+19
| | | | | | | | | | | Turns out the "call" and "return" trace events are really "start frame" and "end frame". They happen not only when functions are entered and left, but when generators yield and resume. We aren't interested in arcs into and out of yield statements, so the trace functions look more closely to see what's really happening, and record an arc in human-friendly terms. Thanks for Mickie Betz for pushing on this bug, although her code is no longer here. :(
* Remove 4 pylint warnings.Ned Batchelder2015-02-091-1/+1
|
* Plugin support is now only in the CTracer, not in the PyTracer.Ned Batchelder2015-02-091-40/+8
|
* Make sure check_include isn't called more than once per file.Ned Batchelder2014-11-281-1/+5
|
* Use the on/off condition to turn off a little more code in PyTracer.Ned Batchelder2014-11-281-6/+6
|