| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
One step of moving to pure pytest tests.
|
|
|
|
|
|
|
|
|
|
|
| |
* Add combine --keep
Related to https://github.com/nedbat/coveragepy/issues/1108
* Fix unit tests
* Fix line too long
* Fix line too long
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tests were failing because of differences in file paths. It was
comparing:
C:\Users\runneradmin\AppData\...
to:
C:\Users\RUNNER~1\AppData\...
and failing. These changes normalize the file paths so the comparisons
work properly.
|
| |
|
| |
|
|
|
| |
Fixes: #268
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|