Age | Commit message (Collapse) | Author |
|
|
|
|
|
On Windows, os.path.samefile returns false for paths mounted in UNC paths which
point to the same location.
I couldn't reproduce the actual case reported, but looking at the code it seems
this commit should fix the issue.
Fix #7678
Fix #8076
|
|
Fix handling recursive symlinks
|
|
When pytest was run on a directory containing a recursive symlink it failed
with ELOOP as the library was not able to determine the type of the
direntry:
src/_pytest/main.py:685: in collect
if not direntry.is_file():
E OSError: [Errno 40] Too many levels of symbolic links: '/home/florian/proj/pytest/tests/recursive'
This is fixed by handling ELOOP and other errors in the visit function in
pathlib.py, so the entries whose is_file() call raises an OSError with the
pre-defined list of error numbers will be exluded from the result.
The _ignore_errors function was copied from Lib/pathlib.py of cpython 3.9.
Fixes #7951
|
|
|
|
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
|
|
|
|
|
|
|
|
terminal: fix crash in header reporting when absolute testpaths is used
|
|
|
|
|
|
|
|
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.
|
|
An equivalent for these py.path.local functions is needed for some
upcoming py.path -> pathlib conversions.
|
|
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.
|
|
|
|
`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.
|
|
Part of reducing dependency on `py`. Also enables upcoming improvements.
In cases where there are simpler alternatives (in tests), I used those.
What's left are a couple of uses in `_pytest.main` and `_pytest.python`
and they only have modest requirements, so all of the featureful code
from py is not needed.
|
|
Fix #7500
Co-authored-by: Ran Benita <ran@unusedvar.com>
|
|
|
|
|
|
Fix #5821
Co-authored-by: Ran Benita <ran@unusedvar.com>
|
|
Fix #5456
|
|
|
|
|
|
#5965 (#6523)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
|
|
|
|
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
|
|
Since Python 3.3, these are aliases for OSError:
https://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy
|
|
|
|
Ref: https://github.com/pytest-dev/pytest/pull/6044/files#r339321752
|
|
At least the ones I was sure of.
|
|
|
|
This reverts commit 955e54221008aba577ecbaefa15679f6777d3bf8, reversing
changes made to 0215bcd84e900d9271558df98bed89f4b96187f8.
Will attempt a simpler approach
|
|
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
|
|
Use OSError subclasses instead of handling errno
|
|
|
|
Warnings are emitted if we cannot safely remove
paths.
Fix #5626
|
|
|
|
Fix #5524
|
|
|
|
|
|
|
|
|
|
|
|
* Update setup.py requires and classifiers
* Drop Python 2.7 and 3.4 from CI
* Update docs dropping 2.7 and 3.4 support
* Fix mock imports and remove tests related to pypi's mock module
* Add py27 and 34 support docs to the sidebar
* Remove usage of six from tmpdir
* Remove six.PY* code blocks
* Remove sys.version_info related code
* Cleanup compat
* Remove obsolete safe_str
* Remove obsolete __unicode__ methods
* Remove compat.PY35 and compat.PY36: not really needed anymore
* Remove unused UNICODE_TYPES
* Remove Jython specific code
* Remove some Python 2 references from docs
Related to #5275
|
|
|
|
|