Age | Commit message (Collapse) | Author |
|
* [pre-commit.ci] pre-commit autoupdate
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* manual fixes after configuration update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Anthony Sottile <asottile@umich.edu>
|
|
It adds no value over exporting just the ABC so do that to reduce the
API surface.
|
|
|
|
|
|
|
|
|
|
- Some conftest related functions
- _confcutdir
- Allow arbitrary os.PathLike[str] in gethookproxy.
|
|
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
|
|
ischildnode can be quite hot in some cases involving many fixtures.
However it is always used in a way that the nodeid is constant and the
baseid is iterated. So we can save work by pre-computing the parents of
the nodeid and use a simple containment test.
The `_getautousenames` function has the same stuff open-coded, so change
it to use the new function as well.
|
|
|
|
- Change the fixtures plugin to store its one piece of data on the node's
Store instead of directly.
- Import FixtureLookupError lazily.
|
|
|
|
|
|
|
|
automated with:
```bash
git grep -l 'from .* import TYPE_CHECKING' |
xargs reorder-python-imports \
--application-directories .:src \
--remove-import 'from _pytest.compat import TYPE_CHECKING' \
--add-import 'from typing import TYPE_CHECKING'
```
|
|
|
|
As related in #7696
|
|
This reverts commit f10ab021e21a44e2f0fa2be66660c4a6d4b7a61a.
The commit was good in that it removed a non-trivial amount of code
duplication. However it was done in the wrong layer (nodes.py) and split
up a major part of the collection (the filesystem traversal) to a
separate class making it harder to understand.
We should try to reduce the duplication, but in a more appropriate
manner.
|
|
|
|
|
|
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 e2934c3f8c03c83469f4c6670c207773a6e02df4 and
f10ab021e21a44e2f0fa2be66660c4a6d4b7a61a for reference.
|
|
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.
|
|
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.
|
|
|
|
`os.scandir()`, introduced in Python 3.5, is much faster than
`os.listdir()`. See https://www.python.org/dev/peps/pep-0471/.
It also has a `DirEntry` which can be used to further reduce syscalls in
some cases.
|
|
Not needed since pyflakes 2.2.0.
|
|
This mistake was introduced in 7259c453d6c1dba6727cd328e6db5635ccf5821c.
|
|
Fix #5821
Co-authored-by: Ran Benita <ran@unusedvar.com>
|
|
These errors are found using a typed version of py.path.local.
|
|
|
|
This option checks even functions which are not annotated. It's a good
step to ensure that existing type annotation are correct.
In a Pareto fashion, the last few holdouts are always the ugliest,
beware.
|
|
|
|
|
|
|
|
Annotate some "easy" arguments of hooks that repeat in a lot of internal
plugins.
Not all of the arguments are annotated fully for now.
|
|
|
|
On Windows specifically is common to have drives diverging just by
casing ("C:" vs "c:"), depending on the cwd provided by the user.
|
|
Fixes https://github.com/pytest-dev/pytest/issues/6428.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
code: fix import cycles between code.py and source.py
|
|
|
|
Turns out it's called alot, and saving the function call makes it
faster.
|
|
These two files were really intertwined. Make it so code.py depends on
source.py without a reverse dependency.
No functional changes.
|
|
|
|
|