summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* fix: don't overwrite a .gitignore in the html output directory. #1244nedbat/1244-againNed Batchelder2021-11-121-0/+7
|
* test(refactor): convert looping tests to parametrizeNed Batchelder2021-11-113-51/+45
|
* style: convert more string formatting to f-stringsNed Batchelder2021-11-1115-32/+30
|
* refactor: we no longer need to treat 'class' lines speciallyNed Batchelder2021-11-111-3/+3
| | | | | Originally, this tokenizing code was paired with bytecode analysis. But now we use AST instead, so class lines don't need to be handled differently.
* fix: colons in decorators shouldn't stop an exclusionNed Batchelder2021-11-101-1/+21
|
* fix: CPython 3.11 support. #1241Ned Batchelder2021-11-102-0/+4
| | | | | | | | | | | The fix for CTracer is egregious and will need to be updated when there's a supported way to do it. The fullcoverage skip is noted in https://github.com/nedbat/coveragepy/issues/1278 The raise_through_with skip is noted in https://github.com/nedbat/coveragepy/issues/1270
* fix: warn about more source file problemsNed Batchelder2021-11-091-1/+6
|
* refactor(test): convert eight tests to one parametrized testNed Batchelder2021-11-071-27/+4
|
* refactor(test): use the expected name for initializing tests.Ned Batchelder2021-11-079-27/+24
| | | | | | | | | Originally I used setup_test because something went wrong when I used setUp. I wrote https://github.com/pytest-dev/pytest/issues/8424 about it. There they say to use `-p no:nose` to disable nose interpretation. But now I simply went back to setUp, and all seems well? Not sure what changed, but using the expected name is better.
* fix: remapping paths during combining needs to follow relative_files=True. #1147Ned Batchelder2021-11-062-76/+101
|
* fix: give a default value to the name argument for Matchers. #1273Ned Batchelder2021-11-051-6/+6
|
* fix: don't report branches to exclusions as missing. #1271Ned Batchelder2021-11-051-1/+15
|
* refactor(test): make traceback checks a bit flexibleNed Batchelder2021-11-042-7/+11
| | | | | | | | | | | | Python 3.11 made a traceback look like this: Traceback (most recent call last): File "{path}", line 8, in <module> print(sys.argv[1]) ~~~~~~~~^^^ IndexError: list index out of range We needed to not care if that tilde-caret line was present or not.
* refactor(test): don't even import contracts if not using PyContractsNed Batchelder2021-11-041-2/+2
| | | | | | | | 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.
* test(fix): isolate excepthook tests from each otherNed Batchelder2021-11-022-0/+9
|
* build(test): remove obsolete jQuery gold files #840Ned Batchelder2021-11-026-182/+23
|
* test: force VirtualenvTest onto one worker to save timeNed Batchelder2021-11-021-7/+50
| | | | | | | | | | | VirtualenvTest is slow because it has a session-scoped fixture that takes 10s to run. If all of those tests go to the same worker, we can reuse that fixture. If they go to different workers, we have to spend that time more than once. This is a hack which seems to work, but no guarantees into the future. Also, I don't know why the VirtualenvTests aren't run first on their worker. Time saved: about 10%, from ~50s to ~45s.
* perf(test): run pip just once, shaves 1.2s off the fixtureNed Batchelder2021-10-311-8/+9
| | | | ... though that means it's 8.1s instead of 9.3s, so still pretty slow.
* test: use the coverage-command fixture throughout the venv testsNed Batchelder2021-10-311-4/+4
|
* fix: don't warn about already imported files for namespace packages #888Ned Batchelder2021-10-311-2/+52
| | | | Ignore namespace packages in the already-imported check. #888
* refactor(test): the virtualenv tests deserve their own fileNed Batchelder2021-10-312-263/+277
|
* debug: code we can enable to see where tests are running and in what orderNed Batchelder2021-10-301-1/+9
|
* chore: update HTML gold filesNed Batchelder2021-10-3024-74/+77
| | | | test: I keep forgetting about the 3.10-only gold file
* test: fix the trailing-space test, and suppress warnings about \<space>Ned Batchelder2021-10-302-12/+18
|
* style: remove implicit string concatenationNed Batchelder2021-10-302-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .. 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">&lt;</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">&lt;</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">&lt;</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
* deprecated: the annotate command will be removed in a future versionNed Batchelder2021-10-291-1/+6
|
* refactor(test): make re_lines (et al) look like re.searchNed Batchelder2021-10-287-74/+68
| | | | and also replace some calls with just-plain re.search.
* refactor(test): name this gold file properlyNed Batchelder2021-10-282-1/+1
|
* test: add a annotate test, and simplify the logicNed Batchelder2021-10-282-0/+30
|
* feat: html output directory gets a .gitignore file. #1244Ned Batchelder2021-10-271-0/+1
|
* fix(debug): ast_dump failed on a few thingsNed Batchelder2021-10-273-16/+37
|
* refactor(test): re_lines is more useful if it returns a listNed Batchelder2021-10-274-19/+28
|
* feat: xml and json say what they are doing, and -q quiets everything. #1254nedbat/dashqNed Batchelder2021-10-265-16/+59
|
* test: a true unit test for render_reportNed Batchelder2021-10-261-0/+50
|
* refactor: alphabetize the optionsNed Batchelder2021-10-261-53/+53
|
* fix: changes for PyPy3.8Ned Batchelder2021-10-253-1/+4
| | | | | | | | | | - Update tox.ini to let us run against PyPy3.8 - Some 3.8 behavior is (apparently) only on CPython - PyPy3.8 doesn't get along with virtualenv yet (https://github.com/pypa/virtualenv/issues/2182), so use venv instead for our virtualenv tests.
* test: also test goldtest bad xmlNed Batchelder2021-10-252-14/+37
|
* test: finishing covering goldtest.py with test_goldtest.pyNed Batchelder2021-10-244-24/+78
|
* test: test compare() from test/goldtest.pyNed Batchelder2021-10-243-45/+125
|
* refactor(test): os_sep and remove_tree helpersNed Batchelder2021-10-246-24/+30
|
* fix(html): ariaSort isn't supported in Firefox yetNed Batchelder2021-10-233-14/+12
| | | | The HTML report index page wasn't indicating the sort order properly
* chore(test): update gold filesNed Batchelder2021-10-2327-213/+217
|
* test: update gold filesNed Batchelder2021-10-2343-2063/+1890
|
* fix(html): fix a few problems with the html reportNed Batchelder2021-10-233-15/+32
| | | | | | | | | | - highlights weren't showing - anchored lines were not visible - some j/k motions were broken - clicking the big buttons at the top didn't work
* test: sometimes pytest directories have a "popen" componentNed Batchelder2021-10-231-3/+4
| | | | | Those have to be scrubbed too. I'm not sure why it's sometimes there, sometimes not. Maybe xdist?
* refactor: no more need for a search path for static filesNed Batchelder2021-10-231-57/+1
| | | | | | | We used to search an OS-specific directory in addition to our own, specifically so that Debian could use an OS-installed copy of jQuery and its plugins. But we no longer have jQuery or any third-party JavaScript code, so we don't need to search the Debian directories.
* refactor(html): remove all uses of jQuery, only vanilla JS nowSeptatrix2021-10-231-8/+12
| | | | This is squashed from pull request #1248
* refactor(html): a one-header sticky headerNed Batchelder2021-10-231-31/+33
|
* fix(html): scrolling to an anchor ensures the line is visibleNed Batchelder2021-10-201-3/+3
| | | | | | | The sticky header was hiding the line scrolled to the top of the window. Along the way, also changed to use classes on <body> to control the sticky header, and moved the header code into a function.
* fix: avoid measuring generated code. #1160Ned Batchelder2021-10-181-3/+19
|