Commit Graph

11417 Commits

Author SHA1 Message Date
Bruno Oliveira f36ea240fe
Remove check for os.symlink, always there in py3+ (#6227)
Remove check for os.symlink, always there in py3+
2019-11-18 22:37:59 -03:00
Daniel Hahler 4804d4bc98 python: remove unused pytest_make_parametrize_id hookimpl
Added in 79927428d initially, but never used.
2019-11-19 02:27:53 +01:00
Daniel Hahler b820b7e384
Merge pull request #6224 from blueyed/visit_Assert-minor-cleanup
minor: visit_Assert: move setting of `negation` out of branches
2019-11-19 01:11:53 +01:00
Daniel Hahler 8d3e8b1c54
Revert "ci: use tox -vv" (#6226) 2019-11-19 01:10:06 +01:00
Anthony Sottile 63a23d876c Remove check for os.symlink, always there in py3+ 2019-11-18 16:01:44 -08:00
Anthony Sottile eeeb19626b
Merge pull request #6202 from linw1995/fix_getmodpath
Fix incorrect result of getmodpath method.
2019-11-18 15:14:52 -08:00
Bruno Oliveira bebd80456b
Fix --setup-plan fixture lifetimes (#6214)
Fix --setup-plan fixture lifetimes
2019-11-18 20:04:17 -03:00
Daniel Hahler f38f2d402e minor: visit_Assert: move setting of `negation` out of branches 2019-11-18 23:21:00 +01:00
Daniel Hahler f9feef6808 Revert "ci: use tox -vv"
`tox -vv` is too verbose, and was only used as a hack to get the output
of durations.

As for information in logs `-v` could be used maybe still, but I've
decided to revert it for now.

This reverts commit 56cec5fa79.
2019-11-18 23:14:03 +01:00
Bruno Oliveira 89eeefbbaf
Merge pull request #6192 from nicoddemus/remove-reportlog-6180
Remove report_log in favor of pytest-reportlog
2019-11-18 17:58:37 -03:00
Daniel Hahler ed5f191da2
mypy: config: use mypy_path=src (#6222) 2019-11-18 21:51:39 +01:00
Daniel Hahler b4ff6b3672
Metafunc: remove hack for DefinitionMock (#6223) 2019-11-18 19:56:00 +01:00
Daniel Hahler 2ad2fbc9a2 Metafunc: remove hack for DefinitionMock
Done initially in 99015bfc8.
2019-11-18 18:19:34 +01:00
Daniel Hahler b461010f32 mypy: config: use mypy_path=src
This allows for checking files inside of "testing" without having
"src/…" as an argument also.
2019-11-18 18:12:59 +01:00
Daniel Hahler 64d8910516
Metafunc: remove unused _ids (#6220) 2019-11-18 18:00:29 +01:00
Daniel Hahler b412661de9
Factor out _validate_parametrize_spelling (#6221) 2019-11-18 18:00:00 +01:00
林玮 5d5f480979 Hardening an existing test for demonstrating this change. 2019-11-18 23:46:38 +08:00
Daniel Hahler 91dec8e2bf Factor out _validate_parametrize_spelling
This makes it easier to read `pytest_generate_tests`.
2019-11-18 16:36:12 +01:00
Daniel Hahler f3a10245d0 Metafunc: remove unused _ids
Forgotten in 40b85d7ee.
2019-11-18 16:21:13 +01:00
Josh Karpel 46ffdf0e3a
Update AUTHORS 2019-11-17 17:17:47 -06:00
JoshKarpel 1e3be8ada4 fix whitespace issues in tests for #2049 2019-11-17 17:14:17 -06:00
JoshKarpel 6dfd683a0c changelog entry for #2049 2019-11-17 16:47:09 -06:00
JoshKarpel 9e759010d9 resolve #2049 2019-11-17 16:45:42 -06:00
Anthony Sottile a2d48332fc
Merge pull request #6201 from asottile/mm
Merge master into features
2019-11-17 11:30:51 -08:00
Daniel Hahler bac6eebfff
tests: revisit test_cacheprovider (#6199) 2019-11-17 19:23:16 +01:00
Ran Benita fa578d7329
Merge pull request #6205 from bluetech/type-annotations-8
Add type annotations to _pytest.compat and _pytest._code.code
2019-11-17 09:45:32 +02:00
Daniel Hahler b9a3ba1fe8 test_cache_writefail_permissions: ignore any other plugins 2019-11-16 23:29:24 +01:00
Daniel Hahler 1b4623a6d1 tests: revisit test_cacheprovider 2019-11-16 23:29:24 +01:00
Ran Benita eaa34a9df0 Add type annotations to _pytest._code.code 2019-11-16 22:29:57 +02:00
Daniel Hahler e3796047c1
pre-commit: upgrade black (#6208) 2019-11-16 19:20:12 +01:00
Daniel Hahler 54a954514b re-run black 2019-11-16 18:55:32 +01:00
Daniel Hahler b1a597ab02 Remove (now) unnecessary fmt: off 2019-11-16 18:51:02 +01:00
Daniel Hahler 5d247b9caf pre-commit: upgrade black
This brings https://github.com/psf/black/pull/826, which helps with
https://github.com/psf/black/issues/601.
2019-11-16 18:42:17 +01:00
Daniel Hahler 4b7148f9a4
cacheprovider: set: use json.dumps + write (#6206) 2019-11-16 18:25:28 +01:00
Daniel Hahler 786d839db1 cacheprovider: set: use json.dumps + write
``json.dump`` is slower since it iterates over chunks [1].

For 100 ``cache.set`` calls this saved ~0.5s (2.5s => 2s), using a dict
with 1500 entries, and an encoded size of 500kb.

Python 3.7.4.

1: https://github.com/blueyed/cpython/blob/1c2e81ed00/Lib/json/__init__.py#L177-L180
2019-11-16 17:40:56 +01:00
Ran Benita 562d4811d5 Add type annotations to _pytest.compat 2019-11-16 17:22:11 +02:00
Ran Benita a649f157de Make Source explicitly implement __iter__()
Source was previously iterable because it implements `__getitem__()`,
which is apparently a thing from before `__iter__()` was introduced.
To reduce mypy's and my own confusion, implement `__iter__()` directly.
2019-11-16 17:22:10 +02:00
Ran Benita 307add025b Simplify a FormattedExcinfo test
The previous test was better in that it used fakes to test all of the
real code paths. The problem with that is that it makes it impossible to
simplify the code with `isinstance` checks. So let's just simulate the
issue directly with a monkeypatch.
2019-11-16 17:22:09 +02:00
Ran Benita e3ac44df36 Inline the FuncargnamesCompatAttr compat helper
It doesn't help much IMO, just adds indirection and makes it harder to
type.
2019-11-16 17:22:09 +02:00
Ran Benita 5bfe793fd5 Remove unneeded getrawcode() calls from tests 2019-11-16 17:22:08 +02:00
Ran Benita 04d68fbc9e Remove checks for Python2-only fields im_func and func_code 2019-11-16 17:22:07 +02:00
Ran Benita c7a83a0f31 Remove a PyPy version check for an unsupported version
pytest doesn't support these PyPy versions anymore, so no need to have
checks for them.
2019-11-16 17:22:07 +02:00
Ran Benita f760356578 A few linting fixes
Add some Python 3.8 type: ignores; all are already fixed in the next
mypy release, so can be removed once we upgrade.

Also move some flake8 ignores which seem to have changed places.
2019-11-16 17:22:06 +02:00
Zac Hatfield-Dodds f24f20a46e
Merge pull request #6204 from TH3CHARLie/add-changelog-on-tmp_path_factory
changelog: #3985 also introduce `tmp_path_factory`
2019-11-16 23:57:53 +11:00
TH3CHARLie b090ac6204 remove trailing-whitespace 2019-11-16 18:01:08 +08:00
TH3CHARLie 9c681b45e3 change: #3985 also introduce 2019-11-16 17:34:05 +08:00
林玮 329f56ecec Fix incorrect result of getmodpath method. 2019-11-16 15:28:04 +08:00
Anthony Sottile cc78444c30 Merge remote-tracking branch 'origin/master' into mm 2019-11-15 15:26:57 -08:00
Anthony Sottile 3a668ea6ff
Merge pull request #6198 from asottile/release-5.2.4
Preparing release version 5.2.4
2019-11-15 14:57:08 -08:00
Daniel Hahler c49c61fdaf
Import Path from _pytest.pathlib for py35 (#6193) 2019-11-15 23:17:43 +01:00