summaryrefslogtreecommitdiff
path: root/coverage/inorout.py
Commit message (Collapse)AuthorAgeFilesLines
* fix: don't measure all third-party packages if source is in third-party locationManuel Jacob2023-03-151-12/+13
| | | | | | | | There is logic to not measure third-party packages inside configured sources. However, when a (i.e. another) configured source was inside a third-party location, this logic was previously disabled completely. This caused a problem if a virtual env is set up inside a configured source directory and a configured source package gets installed inside the virtual env. Previously in this case, coverage was measured for all files in the virtual env for the reason described in the previous paragraph. This commit changes the code to collect all configured source directories inside third-party locations and disable coverage for code in third-party locations only if its not in one of these collected source directories.
* fix: make tracing messages easier to understandNed Batchelder2023-01-221-2/+2
|
* style: use good style for annotated defaults parametersNed Batchelder2023-01-051-2/+2
|
* style: betterNed Batchelder2023-01-021-1/+1
|
* mypy: check collector.py and plugin_support.pyNed Batchelder2023-01-011-5/+7
|
* mypy: add env.pyNed Batchelder2022-12-311-3/+3
|
* refactor: removed mentions of Jython and IronPythonNed Batchelder2022-12-301-8/+0
|
* mypy: inorout.py, disposition.py, and part of control.pyNed Batchelder2022-12-301-74/+76
|
* test: remove pycontractsNed Batchelder2022-12-251-9/+0
|
* style: fix spellingNed Batchelder2022-11-281-1/+1
| | | | un-executed, white space, time stamp.
* feat: added support for finding unexecuted namespace packages (#1387)Felix Horvat2022-11-171-2/+6
| | | | | | | | | | | | | | | | | | | * add support for namespace packages * fixed typo * update documentation * fixed lint issues * changed versionadded * convert to config setting * removed pure formatting changes * code review changes Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* fix: use glob matching instead of fnmatch. #1407Ned Batchelder2022-10-301-3/+3
| | | | | | | I didn't understand that fnmatch considers the entire string to be a filename, even if it has slashes in it. This led to incorrect matching. Now we use our own implementation of glob matching to get the correct behavior.
* style: parens should indent the same as their opening lineNed Batchelder2022-05-011-1/+1
|
* refactor: no need to special-case spec.origin == "namespace"Ned Batchelder2022-01-031-2/+1
| | | | | Namespace packages used to have this value, but that was changed in 3.7: https://bugs.python.org/issue32305
* test(fix): keep SourceIncludeOmitTest's from clobbering each otherNed Batchelder2021-11-241-0/+3
| | | | | | | | Because they cd'd into a folder in the shared source tree, their data files would collide, leading to flaky tests. Also, add a check that the tests collected some data, and add sys.path to the debug=trace output.
* refactor: specialize exceptionsNed Batchelder2021-11-141-2/+2
| | | | | | CoverageException is fine as a base class, but not good to use for raising (and catching sometimes). Introduce specialized exceptions that allow third-party tools to integrate better.
* fix: suppress exceptions when finding source= modules. #1203Ned Batchelder2021-11-131-1/+1
|
* refactor(test): don't even import contracts if not using PyContractsNed Batchelder2021-11-041-4/+5
| | | | | | | | On CPython 3.11, PyContracts fails on import, so we need to shut it off more completely. PyContracts is unmaintained these days, so we'll probably get rid of it completely soon.
* fix: don't warn about already imported files for namespace packages #888Ned Batchelder2021-10-311-0/+4
| | | | Ignore namespace packages in the already-imported check. #888
* fix: avoid measuring generated code. #1160Ned Batchelder2021-10-181-0/+3
|
* refactor: no need for specialized pyexpat code anymoreNed Batchelder2021-10-181-5/+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.
* fix: source modules need to be re-imported. #1232Ned Batchelder2021-10-111-18/+20
|
* fix: make third-party detection work with namespace packages. #1231Ned Batchelder2021-10-101-9/+32
|
* style: use the official designation for utf-8Ned Batchelder2021-10-101-1/+1
| | | | | Yes, this is completely unimportant. Don't ask me why I bothered, I'm not really sure.
* fix: correct previous refactoringsNed Batchelder2021-07-281-1/+1
| | | | | File names should not be rendered with !r, since on Windows that will produce double backslashes, which only confuses people.
* refactor: convert %-strings to f-stringsNed Batchelder2021-07-281-4/+3
|
* feat: warnings are now real warningsNed Batchelder2021-05-301-8/+5
| | | | | | 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: move exceptions to their own moduleNed Batchelder2021-05-021-1/+1
|
* refactor: pyupgrade --py36-plus coverage/*.pyNed Batchelder2021-05-021-16/+14
|
* refactor: move the remaining backward.py code, no more backward.pyNed Batchelder2021-05-011-31/+9
|
* refactor: remove yet more unneeded backward.py shimsNed Batchelder2021-05-011-2/+2
| | | | | | | | Gone are: - PYC_MAGIC_NUMBER - code_object - SimpleNamespace
* fix: don't warn that dynamic plugins already imported their source files. #1150Ned Batchelder2021-05-011-0/+5
|
* fix: restore metacov functioningNed Batchelder2021-04-111-2/+0
| | | | | | | The check for coverage files inside the --source check disables our metacoverage. Removing it means that coverage files will still not be measured, but the reason will be given as "is third-party" rather than "is part of coverage.py," which is a small price to pay.
* fix: don't measure third-party scriptsnedbat/bin-excludeNed Batchelder2021-04-111-14/+22
| | | | | | This finishes the last bit of #905 Also includes tighter logging of the reason for not tracing modules.
* debug: label each matcher with its roleNed Batchelder2021-04-111-7/+7
|
* fix: don't measure third-party packagesNed Batchelder2021-04-101-9/+94
| | | | | | | | | | | | Avoid measuring code located where third-party packages get installed. We have to take care to measure --source code even if it is installed in a third-party location. This also fixes #905, coverage generating warnings about coverage being imported when it will be measured. https://github.com/nedbat/coveragepy/issues/876 https://github.com/nedbat/coveragepy/issues/905
* refactor: move stdlib and coverage location logic into functionsNed Batchelder2021-04-101-29/+41
|
* fix: remove debugging code I checked in by accidentNed Batchelder2021-03-191-3/+0
|
* style: correct two recent lint faux pasNed Batchelder2021-03-181-0/+3
|
* Create Way to force package even if filepath exists (#1026)Thomas Grainger2020-09-121-0/+1
| | | Fixes: #268
* More details on --source filteringNed Batchelder2020-06-291-9/+33
|
* Don't trace non-encodable file names. #891Ned Batchelder2020-01-011-0/+6
|
* A helper to get code objectsNed Batchelder2019-12-021-5/+2
|
* Correct some function names and docstrings. #843Ned Batchelder2019-09-091-8/+11
|
* No need for format indexes (mostly)Ned Batchelder2019-09-011-1/+1
|
* Don't try to use PyPy 'filenames' like '<builtin>/lib_pypy/_structseq.py'Ned Batchelder2018-11-251-2/+4
|
* Update NOTICE link to GitHub.Ned Batchelder2018-06-241-1/+1
|
* Finish up the inorout docstringsNed Batchelder2018-03-131-2/+17
|
* check_preimported=True controls whether coverage checks pre-imported files ↵Ned Batchelder2018-03-061-3/+0
| | | | when starting
* In 3.7, namespace modules can have: mod.__file__ is NoneNed Batchelder2018-03-051-7/+16
|