Commit Graph

13171 Commits

Author SHA1 Message Date
Ran Benita eddd993cf4 Only define gethookproxy, isinitpath on Session
This fixes an issue where pylint complains about missing implementations
of abstract methods in subclasses of `File` which only override
`collect()` (as they should).

It is also cleaner and makes sense, these methods really don't need to
be overridden.

The previous methods defined directly on `FSCollector` and `Package` are
deprecated, to be removed in pytest 7.

See commits e2934c3f8c and
f10ab021e2 for reference.
2020-08-15 13:40:16 +03:00
Bruno Oliveira f76b162263 Add ref to Python bug 2020-08-14 11:36:07 -03:00
Ran Benita d426a79a90
Merge pull request #7645 from bluetech/pylint-abc
Don't use NotImplementedError in `@overload`s
2020-08-14 15:33:35 +03:00
Ran Benita f28af14457 Don't use NotImplementedError in `@overload`s
We used it as a shortcut for avoiding coverage, but pylint has a special
interpretation of it as an abstract method which we don't want.
2020-08-14 13:54:46 +03:00
Ran Benita 2c5403b951
Merge pull request #7644 from bluetech/changelog-7631
Add changelog for PR #7631
2020-08-14 11:54:31 +03:00
Ran Benita 8056a677b4 Add changelog for PR #7631 2020-08-14 11:02:44 +03:00
Thomas Grainger 02c6e4455c
document toml use of filterwarnings (#7611)
and include a demo of toml 'literal strings'

Update doc/en/warnings.rst
Apply suggestion by Ran
Fix linting

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-08-14 10:08:17 +03:00
Bruno Oliveira 10f98e1d2f
Merge pull request #7641 from hynek/patch-1
Replace inactive Azure Pipelines badge with GHA
2020-08-13 11:49:45 -03:00
Hynek Schlawack 82181fde3e
Replace inactive Azure Pipelines badge with GHA
Currently the badge encourages you to set it up now. :)
2020-08-13 14:18:36 +02:00
Bruno Oliveira 36c8bb492e get_dirs_from_args handles paths with invalid syntax
Fix #7638
2020-08-12 17:20:09 -03:00
Maximilian Cosmo Sitter 15d8293241
Remove faq.rst from docs (#7635) 2020-08-12 14:47:34 -03:00
Ran Benita 4c92584364
Merge pull request #7631 from bluetech/capture-1
capture: add type annotations to CaptureFixture
2020-08-10 18:38:05 +03:00
Ran Benita acc9310c17 capture: add type annotations to CaptureFixture
It now has a str/bytes type parameter.
2020-08-10 18:14:47 +03:00
Ran Benita 8a66f0a96d capture: overcome a mypy limitation by making CaptureResult a regular class
See the code comment for the rationale.
2020-08-10 18:14:47 +03:00
Bruno Oliveira bee72e1925
Merge pull request #7629 from samestep/patch-1
Fix typos in Ali Afshar's name
2020-08-07 20:02:26 -03:00
Sam Estep a27c539a85
Fix typos in Ali Afshar's name
The correct name is visible in the Bitbucket link.
2020-08-07 15:22:10 -07:00
Ran Benita 384b6f6866
Merge pull request #7619 from bluetech/py-to-pathlib
Some py.path -> pathlib conversions
2020-08-07 11:33:21 +03:00
Ran Benita f8c4e038fd Replace some usages of py.path.local 2020-08-06 18:46:17 +03:00
Ran Benita 70f3ad1c1f config/findpaths: convert from py.path.local to pathlib 2020-08-06 18:46:17 +03:00
Ran Benita 9e55288ba4 pathlib: add absolutepath() as alternative to Path.resolve()
Didn't call it absolute or absolute_path to avoid conflicts with
possible variable names.

Didn't call it abspath to avoid confusion with os.path.abspath.
2020-08-06 18:16:04 +03:00
Ran Benita e0d0951945 pathlib: add analogues to py.path.local's bestrelpath and common
An equivalent for these py.path.local functions is needed for some
upcoming py.path -> pathlib conversions.
2020-08-06 18:16:04 +03:00
Ran Benita aa9905d72e
Merge pull request #7625 from nicoddemus/pypy3-async-unittest-7624
Fix test_plain_unittest_does_not_support_async on pypy3
2020-08-06 08:31:46 +03:00
Bruno Oliveira 67cb7ef673 Fix test_plain_unittest_does_not_support_async on pypy3
Fix #7624
2020-08-05 15:24:08 -03:00
Rüdiger Busche a64298ff5e
Document registering markers in pyproject.toml (#7622)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-08-05 12:03:27 -03:00
Bruno Oliveira 44cd8a3a86
Demonstrate that plain unittest does not support async tests (#7607)
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-08-04 19:37:41 -03:00
Ran Benita 2bd0d97fcc
Merge pull request #7601 from bluetech/typing-longrepr
typing: resultlog, pytester, longrepr
2020-08-04 23:23:56 +03:00
Ran Benita fbf251f11d Improve typing of reports' longrepr field 2020-08-04 22:52:24 +03:00
Ran Benita f0eb82f7d4 pytester: improve type annotations 2020-08-04 22:46:30 +03:00
Ran Benita 62ddf7a0e5 resultlog: add missing type annotations 2020-08-04 22:45:46 +03:00
Ran Benita 303030c141
Merge pull request #7613 from bluetech/typing-warn-unreachable
typing: set warn_unreachable
2020-08-04 22:44:21 +03:00
Bruno Oliveira 0d65e4b454
Merge pull request #7606 from nicoddemus/pre-release-docs
Add docs for releasing major/release candidates
2020-08-04 15:37:19 -03:00
Yutaro Ikeda 84c4b64354
Better document -k partial matching (#7610) 2020-08-04 15:30:08 -03:00
Bruno Oliveira d688fefecb
Merge pull request #7614 from The-Compiler/log-print
Properly remove log_print
2020-08-04 13:39:21 -03:00
Ran Benita 9ab14c6d9c typing: set warn_unreachable
This makes mypy raise an error whenever it detects code which is
statically unreachable, e.g.

    x: int
    if isinstance(x, str):
        ... # Statement is unreachable  [unreachable]

This is really neat and finds quite a few logic and typing bugs.

Sometimes the code is intentionally unreachable in terms of types, e.g.
raising TypeError when a function is given an argument with a wrong
type. In these cases a `type: ignore[unreachable]` is needed, but I
think it's a nice code hint.
2020-08-04 09:59:46 +03:00
Florian Bruhin 1c9b84756f Properly remove log_print
This is a follow up to 3f8200676f which didn't
make it clear that log_print is also removed in the changelog and didn't remove
it from the reference docs.
2020-08-04 08:53:09 +02:00
Ran Benita 0dd5e169d0
Merge pull request #7603 from bluetech/flake8-docstrings
Enforce some pydocstyle lints with flake8-docstrings & docstring fixes in testing/
2020-08-04 08:15:55 +03:00
Ran Benita 9a18b57c7c Enforce some pydocstyle lints with flake8-docstrings
There are some ones we *would* like to enforce, like
    D401 First line should be in imperative mood
but have too many false positives, so I left them out.
2020-08-03 10:21:59 +03:00
Ran Benita b8471aa527 testing: fix some docstring issues
In preparation for enforcing some docstring lints.
2020-08-03 10:10:43 +03:00
Anthony Sottile 701998bf2c
Merge pull request #7598 from nicoddemus/setuptools-scm-pyproject
Configure setuptools_scm using pyproject.toml
2020-08-01 19:17:33 -07:00
Ran Benita be354b36f3
Merge pull request #7604 from bluetech/typing-disallow-any-generics
typing: set disallow_any_generics
2020-08-01 20:55:45 +03:00
Ran Benita be656dd4e4 typing: set disallow_any_generics
This prevents referring to a generic type without filling in its generic
type parameters.

The FixtureDef typing might need some more refining in the future.
2020-08-01 20:39:15 +03:00
Bruno Oliveira d1fa749b83 Add readthedocs config file to use pip for installation 2020-08-01 14:21:36 -03:00
Bruno Oliveira d7ad55bb2a Add docs for releasing major/release candidates
Fix #7447
2020-08-01 13:51:12 -03:00
Ran Benita 1e9c638468
Merge pull request #7602 from ctb/patch-1
Minor formatting fix in xunit_setup.rst
2020-08-01 18:08:03 +03:00
C. Titus Brown a2d562d369
Minor formatting fix in xunit_setup.rst
Fixed location of double-backquote for verbatim text.
2020-08-01 07:33:03 -07:00
Ran Benita 49827adcb9
Merge pull request #7510 from bluetech/docstrings
Format docstrings in a consistent style
2020-08-01 17:32:01 +03:00
Ran Benita cbec0f8c6a CONTRIBUTING: document the docstring style we use 2020-08-01 17:14:38 +03:00
Ran Benita 0242de4f56 Format docstrings in a consistent style 2020-08-01 17:14:37 +03:00
Bruno Oliveira 6882c0368b
Merge pull request #7593 from bluetech/typing-no-implicit-reexport
typing: set no_implicit_reexport
2020-08-01 11:03:47 -03:00
Bruno Oliveira 07f7372aff
Merge pull request #7586 from nicoddemus/cp-release
Merge pull request #7584 from pytest-dev/release-6.0.1
2020-08-01 11:00:38 -03:00