Commit Graph

11942 Commits

Author SHA1 Message Date
Holger Kohr 80d4dd6f0b Replace `==` with `is` for comparison of cache keys
Closes #6497
2020-01-28 18:05:53 -03:00
Ran Benita e440b43258
Merge pull request #6555 from bluetech/nodes-cache-split
Split Session._collection_node_cache to 3 mutually exclusive parts
2020-01-28 22:49:42 +02:00
Daniel Hahler e25d46aae6 typing: MonkeyPatch.context 2020-01-28 21:44:30 +01:00
Daniel Hahler 7c87874277 source_path: py.path.local directly
Via bc7282576.
2020-01-28 19:02:41 +01:00
Daniel Hahler 1cf9e68dbc tests: cover absolute path handling in _compute_fixture_value 2020-01-28 18:53:28 +01:00
Daniel Hahler b2e6f66438 ci: GHA: run less jobs with coverage
This often might be causing for jobs to take longer than 10 minutes,
which is a timeout Codecov uses to wait for successful CI.

Also it is good in general to have CI finish faster, of course.
2020-01-28 17:38:53 +01:00
Daniel Hahler b01e379428 tests: harden test_teardown_many_verbose 2020-01-28 16:37:18 +01:00
Daniel Hahler 1586653102
Merge pull request #6594 from blueyed/merge-master-into-features
Merge master into features
2020-01-28 14:44:22 +01:00
Daniel Hahler 18ac7e0b79
Merge pull request #6593 from blueyed/typing-ignore-more-itertools
typing: ignore false positive with more-itertools
2020-01-28 14:24:24 +01:00
Ronny Pfannschmidt c854daa234
Merge pull request #6595 from blueyed/fix-typing-code-path
typing: fix Code.path
2020-01-28 11:23:49 +01:00
Daniel Hahler 12c5a6af64 typing: fix Code.path
Fixes:

> src/_pytest/_code/code.py:83: error: Incompatible types in assignment
>   (expression has type "str", variable has type "local")  [assignment]
2020-01-28 01:49:45 +01:00
Daniel Hahler 30922ee694 Merge master into features 2020-01-28 01:40:14 +01:00
Daniel Hahler 35ba053f00 typing: ignore false positive with more-itertools
Fixed in https://github.com/erikrose/more-itertools/pull/374.
2020-01-28 01:23:44 +01:00
Daniel Hahler d0cb16010b
Merge pull request #6580 from blueyed/typing-testdir-init
typing: Testdir.__init__
2020-01-28 00:58:11 +01:00
Daniel Hahler ad0f4f0ac0 tests: cover collect_by_name with non-existing 2020-01-28 00:41:46 +01:00
Daniel Hahler 9c716e4d74 typing: Testdir.plugins 2020-01-28 00:41:46 +01:00
Daniel Hahler 94ac0f7e6b typing: self._mod_collections, collect_by_name 2020-01-28 00:41:46 +01:00
Daniel Hahler 440881d63a typing: Testdir.__init__ 2020-01-28 00:41:46 +01:00
Daniel Hahler aa318e9adf
Merge pull request #6587 from blueyed/mypy-show_error_codes
mypy: show_error_codes=True
2020-01-27 22:58:48 +01:00
Daniel Hahler 20b66e60c0
Merge pull request #6566 from blueyed/rm-encodedfile-writelines
Fix `EncodedFile.writelines`
2020-01-27 22:58:31 +01:00
Daniel Hahler d017b69f38 mypy: show_error_codes=True 2020-01-27 22:18:35 +01:00
Ran Benita ae5d16be10 typing: FSHookProxy/gethookproxy
Taken out of https://github.com/pytest-dev/pytest/pull/6556.
2020-01-27 20:57:44 +01:00
ParetoLife cbad319736
Update getting-started.rst
From the description it seemed to me as if just prefixing your methods with ``test_`` was enough, but you also need to prefix your class with ``Test``. Of course, in the reference material this is clearly stated, but I think it makes sense to mention it here as well, since you also mention the part about the methods' prefix.
2020-01-27 10:50:05 +01:00
Zac Hatfield-Dodds a9eab07739
Merge pull request #6576 from blueyed/test_via_exec
tests: add test_via_exec
2020-01-27 17:57:28 +11:00
Daniel Hahler c2980eb80f pytester: test for _makefile joining an absolute path
Ref: https://github.com/pytest-dev/pytest/pull/6578#discussion_r371035867
2020-01-27 01:00:55 +01:00
Daniel Hahler bf5c76359c fixup! typing: tests: tmpfile 2020-01-26 23:14:32 +01:00
Daniel Hahler 40758e86ca tests: add test_via_exec
Via https://github.com/pytest-dev/pytest/issues/6574.
2020-01-26 23:04:18 +01:00
Daniel Hahler d678d380cb typing: tests: tmpfile 2020-01-25 19:21:19 +01:00
Daniel Hahler 3f8f395210 typing: EncodedFile 2020-01-25 19:20:48 +01:00
Daniel Hahler 7c52a37d46
Merge pull request #6572 from blueyed/fix-test_collection_collect_only_live_logging
tests: test_collection_collect_only_live_logging: allow for 1+s
2020-01-25 19:05:37 +01:00
Daniel Hahler 198b1dcffd
Merge pull request #6573 from blueyed/codecov-curl-retry-connrefused
ci: codecov: use `--retry-connrefused` with curl
2020-01-25 19:05:13 +01:00
Daniel Hahler e2934c3f8c Move common code between Session and Package to FSCollector 2020-01-25 19:04:01 +01:00
Daniel Hahler 6b7e1a246c Sync `{Session,Package}.gethookproxy`
Only copy'n'paste error from c416b1d935.
2020-01-25 19:04:01 +01:00
Daniel Hahler 817c094ce6 Clean up Package.__init__
Makes `parent` a required arg, which would have failed before via
`parent.session` anyway.

Keeps calling/passing unused args for B/C.
2020-01-25 19:04:01 +01:00
Daniel Hahler df1f43ee28 ci: codecov: use `--retry-connrefused` with curl
While it might not help with the following, it certainly might happen as
well.

```
+ curl -S -L --connect-timeout 5 --retry 6 -s https://codecov.io/bash -o codecov-upload.sh
curl: (16) Error in the HTTP2 framing layer
```
2020-01-25 18:22:03 +01:00
Daniel Hahler 778d4364fa tests: test_collection_collect_only_live_logging: allow for 1s
Might be slow on CI.

Ref: https://github.com/pytest-dev/pytest/pull/6570/checks?check_run_id=408752475#step:6:109
2020-01-25 18:14:49 +01:00
Daniel Hahler 039d582b52 Fix `EncodedFile.writelines`
This is implemented by the underlying stream already, which additionally
checks if the stream is not closed, and calls `write` per line.

Ref/via: https://github.com/pytest-dev/pytest/pull/6558#issuecomment-578210807
2020-01-25 18:06:50 +01:00
Daniel Hahler 9b8039cf09 Sync `{Session,Package}._recurse` 2020-01-25 16:44:20 +01:00
Daniel Hahler b687f20d25
Merge pull request #6375 from hugovk/rm-deprecated-license_file-metadata
Remove deprecated license_file from setup.cfg
2020-01-25 16:20:48 +01:00
Daniel Hahler 510be29db8
Merge pull request #6534 from blueyed/test_plugin_loading_order
tests: add test_plugin_loading_order
2020-01-25 16:20:06 +01:00
Hugo fe343a79f8 Remove deprecated license_file from setup.cfg
Starting with wheel 0.32.0 (2018-09-29), the `license_file` option is deprecated.

* https://wheel.readthedocs.io/en/stable/news.html

The wheel will continue to include `LICENSE`, it is now included automatically:

* https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file

And `LICENSE` is still included in sdists thanks to setuptools-scm:

* https://github.com/pytest-dev/pytest/pull/6348#issuecomment-567836331
2020-01-25 17:08:00 +02:00
Daniel Hahler 1e3bc1814d typing for test_summary_stats 2020-01-25 15:09:02 +01:00
Daniel Hahler 57512aa997 _get_main_color: no yellow ("boring") for non-last item
- refactor _get_main_color/build_summary_stats_line
- factor out property _is_last_item; test_summary_stats: tr._is_last_item
- _write_progress_information_filling_space: remove color arg
- use setter for stats, handling main color
- _get_main_color: skip cache for last item
- Handle random order in test for py35.
2020-01-25 15:09:02 +01:00
Daniel Hahler 2e8f7ef31b
Merge pull request #6569 from blueyed/merge-master-into-features
Merge master into features
2020-01-25 14:40:24 +01:00
Daniel Hahler c51173d426 Merge master into features 2020-01-25 14:18:02 +01:00
Daniel Hahler 2da331ea9c
Merge pull request #6568 from bluetech/redundant-commas
Remove a couple of redundant commas
2020-01-25 14:17:01 +01:00
Ran Benita 94d8c071b6 Remove a couple of redundant commas
Mypy complains about this once the function is typed:

src/_pytest/main.py:85: error: "_addoption" of "OptionGroup" does not return a value
src/_pytest/main.py:133: error: "addoption" of "OptionGroup" does not return a value
2020-01-25 14:12:47 +01:00
Daniel Hahler 0d55fb3797
Merge pull request #6567 from blueyed/codecov-config
ci: codecov: only use "comment: off"
2020-01-25 14:00:32 +01:00
Ran Benita f3967333a1 Split Session._collection_node_cache to 3 mutually exclusive parts
Previously, this cache was used with 3 different and mutually exclusive
key-type -> value-type combinations. Mypy can't properly type this. It's
also quite confusing.

Split to 3 different dicts instead.
2020-01-25 14:31:12 +02:00
Ran Benita a76bc64c54
Merge pull request #6547 from bluetech/session-initialparts
Refactor Session._initialparts to have a more explicit type
2020-01-25 14:30:26 +02:00