| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
Also, move tests to test_data.py, and finish covering the code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add purge_files method to CoverageData, to allow for selective removal and update
of coverage data.
* Fix assert syntax so it's not true; this code isn't reached in the test unless it fails
and then it would have failed to fail.
* Remove trailing whitespace; did not expect this would matter on a blank line.
* Add type annotations required by mypy
---------
Co-authored-by: Stephan Deibel <sdeibel@wingware.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
un-executed, white space, time stamp.
|
| |
|
|
|
|
|
|
|
|
|
| |
When generating many parallel data files, often some data files will be exact
copies of each other. Checking the hashes, we can avoid combining the
duplicates, speeding the process.
On a coverage.py metacov, we had 651 duplicates out of 2189 files (29%).
The time to combine was reduced by 17%.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
Also btw, I think some of these tests are duplicative.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The old code expected a dict with int keys, but iterables are simpler, so get
rid of a lot of dict.fromkeys() nonsense.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.. and also add trailing commas where needed to remove ambiguity.
I used semgrep with this config:
```
rules:
- id: implicit-string-concatenation
pattern: |
"$X" "$Y"
languages:
- python
message: string cat BAD
severity: INFO
```
Running it showed this:
```
$ semgrep --config=../lab/string-cat.yml coverage tests doc ci igor.py setup.py __main__.py
Running 1 rules...
setup.py
severity:info rule:lab.implicit-string-concatenation: string cat BAD
128: 'https://tidelift.com/subscription/pkg/pypi-coverage'
129: '?utm_source=pypi-coverage&utm_medium=referral&utm_campaign=pypi'
tests/test_api.py
severity:info rule:lab.implicit-string-concatenation: string cat BAD
319: "!coverage.py: This is a private format, don't read it directly!"
320: '{"lines":{"/private/tmp/foo.py":[1,5,2,3]}}'
tests/test_html.py
severity:info rule:lab.implicit-string-concatenation: string cat BAD
614: ('<span class="key">if</span> <span class="num">1</span> '
615: '<span class="op"><</span> <span class="num">2</span>'),
--------------------------------------------------------------------------------
616: (' <span class="nam">a</span> '
617: '<span class="op">=</span> <span class="num">3</span>'),
--------------------------------------------------------------------------------
665: ('<span class="key">if</span> <span class="nam">x</span> '
666: '<span class="op"><</span> <span class="num">2</span>'),
--------------------------------------------------------------------------------
667: (' <span class="nam">a</span> <span class="op">=</span> '
668: '<span class="num">3</span>'),
--------------------------------------------------------------------------------
949: ('<span class="key">if</span> <span class="num">1</span> '
950: '<span class="op"><</span> <span class="num">2</span>'),
--------------------------------------------------------------------------------
951: (' <span class="nam">a</span> <span class="op">=</span> '
952: '<span class="num">3</span>'),
ran 1 rules on 134 files: 8 findings
```
This wasn't all of the instances, so I wrote a bug report: https://github.com/returntocorp/semgrep/issues/4184
|
| |
|
|
|
|
| |
combined. #1105 (#1208)
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Gone are:
- PYC_MAGIC_NUMBER
- code_object
- SimpleNamespace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removed were:
- StringIO
- configparser
- string_class
- unicode_class
- range
- zip_longest
- get_thread_id
- path_types
- shlex_quote
- reprlib
|
| |
|
|
|
|
|
|
|
|
|
| |
unittest_mixins would check that files got created if a test made a
temporary directory, so that we could trim down making temp dirs
needlessly.
But we don't use unittest_mixins any more, so this setting does nothing.
Remove it.
|
|
|
|
| |
We don't need to use the one from unittest_mixins.
|
|
|
|
|
|
| |
The auto-decorating metaclass was interfering with parameterized methods
on Python 2.7. But we don't need it anymore anyway, since pytest will
let us hook to deal with the exception in a simpler way.
|
| |
|
| |
|
| |
|
|
|
|
| |
Another step toward removing unittest.TestCase.
|
|
|
|
| |
This is another step toward removing unittest.TestCase as a base class.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
I guess the original line was wrong, but it would have been nice for
unittest2pytest to fix it for me:
https://github.com/pytest-dev/unittest2pytest/issues/52
|