summaryrefslogtreecommitdiff
path: root/coverage/files.py
Commit message (Collapse)AuthorAgeFilesLines
* fix: specific files to include/omit should match even with relative files #1604.Ned Batchelder2023-04-271-3/+2
|
* style: double quotesNed Batchelder2023-03-221-3/+3
|
* style: use good style for annotated defaults parametersNed Batchelder2023-01-051-7/+7
|
* mypy: test_debug.py test_execfile.py test_filereporter.py test_files.pyNed Batchelder2023-01-041-1/+1
|
* mypy: misc.py, test_misc.pyNed Batchelder2023-01-031-8/+5
|
* style: betterNed Batchelder2023-01-021-2/+0
|
* fix: relative_files should keep relative path maps. #1519Ned Batchelder2023-01-021-4/+9
|
* test: add type annotations for files.pyNed Batchelder2022-12-271-50/+63
|
* fix: also look into .whl files for sourceNed Batchelder2022-12-231-2/+2
|
* fix: more information when mapping rules aren't working right.Ned Batchelder2022-12-231-0/+4
|
* fix: don't forbid plus signs in file names. #1513Ned Batchelder2022-12-231-1/+1
|
* fix: when checking source existence for remapping, zipfiles are okNed Batchelder2022-12-011-1/+30
|
* fix: prevent infinite recursionNed Batchelder2022-12-011-3/+8
| | | | | If using relative file paths, and a file remapping failed, we'd get an infinite recursion.
* feat: file paths are only remapped if the result existsNed Batchelder2022-11-291-2/+7
|
* refactor, docs: clean-up for #1387Ned Batchelder2022-11-171-6/+12
|
* feat: added support for finding unexecuted namespace packages (#1387)Felix Horvat2022-11-171-2/+3
| | | | | | | | | | | | | | | | | | | * 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: path-mapped results shouldn't start with ./Ned Batchelder2022-11-081-0/+3
| | | | Unless the actual result in the config starts with ./
* test: this loop never finishes, and that's fineNed Batchelder2022-11-081-1/+1
| | | | Because the last pattern in G2RX_TOKENS is ".", so it always matches.
* fix: use glob matching instead of fnmatch. #1407Ned Batchelder2022-10-301-24/+55
| | | | | | | 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.
* feat: implicitly combine relative pathsNed Batchelder2022-10-151-0/+14
|
* fix: */foo matches "foo/x.py", to help with combining relative file names. #991Ned Batchelder2022-10-151-0/+2
|
* refactor: remove minor pre-3.7 complexityNed Batchelder2022-10-021-3/+2
|
* feat: --debug=pathmap will show details of re-mapping due to [paths] setting.Ned Batchelder2022-09-161-11/+22
|
* fix: paths were wrong when running from root (#1403)Arthur Rio2022-08-061-1/+7
| | | | | | | * Fix paths when running coverage from root * Add simple tests * Use nested pattern for older python versions
* style: use new regex match object group accessNed Batchelder2022-07-081-2/+2
|
* refactor: we no longer need to protect against UnicodeError, it was only on 3.6Ned Batchelder2022-01-031-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was the failure it was protecting against on Python 3.6: ``` ___________________________ ProcessTest.test_lang_c ____________________________ [gw0] linux -- Python 3.6.15 /home/runner/work/coveragepy/coveragepy/.tox/py36/bin/python self = <tests.test_process.ProcessTest object at 0x7fe57e63b198> @pytest.mark.skipif(env.PYPY, reason="PyPy is unreliable with this test") # Jython as of 2.7.1rc3 won't compile a filename that isn't utf-8. @pytest.mark.skipif(env.JYTHON, reason="Jython can't handle this test") def test_lang_c(self): # LANG=C forces getfilesystemencoding on Linux to 'ascii', which causes # failures with non-ascii file names. We don't want to make a real file # with strange characters, though, because that gets the test runners # tangled up. This will isolate the concerns to the coverage.py code. # https://github.com/nedbat/coveragepy/issues/533 self.make_file("weird_file.py", r""" globs = {} code = "a = 1\nb = 2\n" exec(compile(code, "wut\xe9\xea\xeb\xec\x01\x02.py", 'exec'), globs) print(globs['a']) print(globs['b']) """) self.set_environ("LANG", "C") out = self.run_command("coverage run weird_file.py") > assert out == "1\n2\n" E assert 'Traceback (m...ion by zero\n' == '1\n2\n' E - 1 E - 2 E + Traceback (most recent call last): E + File "/home/runner/work/coveragepy/coveragepy/coverage/files.py", line 149, in abs_file E + path = os.path.realpath(path) E + File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/posixpath.py", line 395, in realpath E + path, ok = _joinrealpath(filename[:0], filename, {}) E + File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/posixpath.py", line 429, in _joinrealpath E + if not islink(newpath): E + File "/opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/posixpath.py", line 171, in islink E + st = os.lstat(path) E + UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-6: ordinal not in range(128) ```
* refactor: super-nit-picky tweaks from mypyNed Batchelder2021-11-211-2/+2
|
* 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: remapping paths during combining needs to follow relative_files=True. #1147Ned Batchelder2021-11-061-2/+5
|
* fix: give a default value to the name argument for Matchers. #1273Ned Batchelder2021-11-051-3/+3
|
* fix: use human sorting on human-readable thingsNed Batchelder2021-10-121-2/+2
|
* style: the name of the matchers don't need quotes in the reprsNed Batchelder2021-10-101-3/+3
|
* test: canonicalize this bit of debug outputNed Batchelder2021-10-081-1/+1
|
* fix: generate flat file names differentlyNed Batchelder2021-07-151-8/+9
| | | | | | | | Fixes a few unusual issues with reports: - #580: HTML report generation fails on too long path - #584: File collisions in coverage report html - #1167: Remove leading underscore in coverage html
* refactor: remove a now no-op functionNed Batchelder2021-05-021-8/+1
|
* refactor: move exceptions to their own moduleNed Batchelder2021-05-021-1/+2
|
* refactor: pyupgrade --py36-plus coverage/*.pyNed Batchelder2021-05-021-8/+8
|
* refactor: remove code explicitly choosing between py2 and py3Ned Batchelder2021-05-011-16/+4
|
* debug: label each matcher with its roleNed Batchelder2021-04-111-6/+9
|
* fix: make TreeMatcher right for case-sensitive worldsNed Batchelder2021-04-101-2/+4
|
* fix: combine aliases on windows base dirs (ie: ``X:\``) (fixes: #577)Valentin Lab2021-01-171-2/+4
| | | | Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
* Don't do vars and users in abs_fileNed Batchelder2019-11-281-3/+2
| | | | It meant file names could be incorrectly expanded.
* Adapt to 3.9's way of reporting files using absolute paths.Ned Batchelder2019-11-251-0/+7
|
* No need for format indexes (mostly)Ned Batchelder2019-09-011-1/+1
|
* Make sure that the cache is properly filled. (25x speedup on our system that ↵Stephan Richter2019-01-281-2/+3
| | | | | | has a large sys.path.) It is always a bad idea to reassign the cachekey during the computation.
* Keep windows working in the face of bizarre errorsNed Batchelder2018-09-091-1/+3
|
* Move fiddly fnmatch logic into its own testable functionNed Batchelder2018-09-021-25/+37
|
* Update NOTICE link to GitHub.Ned Batchelder2018-06-241-1/+1
|
* Simplify the aliases structureNed Batchelder2018-01-231-4/+4
|
* Ensure mapped paths use the separator of the result. #618Ned Batchelder2018-01-221-2/+1
|