Age | Commit message (Collapse) | Author |
|
Not smart enough to understand the previous code.
|
|
|
|
As part of the ongoing migration for py.path to pathlib, make sure all
hooks which take a py.path.local also take an equivalent pathlib.Path.
|
|
Avoid showing a line like
x.py::test_4 XPASS () [100%]
which looks funny.
|
|
|
|
* Migrate to pytester: test_capture.py, test_config.py, approx.py
* migrate test_terminal.py
* revert test_config.py
* more typing in test_terminal.py
* try-out 'tr' fixture update
* revert 'tr' fixture, update test_config.py
|
|
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
|
|
Part of investigating a bug, but didn't fix it.
|
|
|
|
|
|
terminal: fix crash in header reporting when absolute testpaths is used
|
|
|
|
Regressed in 6.1.0 in 62e249a1f934d1073c9a0167077e133c5e0f6270.
The `x` is an `str` but is expected to be a `pathlib.Path`. Not caught
by mypy because `config.getini()` returns `Any`.
Fix by just removing the `bestrelpath` call:
- testpaths are always relative to the rootdir, it thus would be very
unusual to specify an absolute path there.
- The code was wrong even before the regression: `py.path.local`'s
`bestrelpath` function expects a `py.path.local`, not an `str`. But it
had some weird `try ... except AttributeError` fallback which just
returns the argument, i.e. it was a no-op. So there is no behavior
change.
- It seems reasonable to me to just print the full path if that's what
the ini specifies.
|
|
|
|
|
|
In preparation for enforcing some docstring lints.
|
|
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.
|
|
Not needed since pyflakes 2.2.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`TerminalWriter`, imported recently from `py`, contains its own
incomplete wcwidth (`char_with`/`get_line_width`) implementation. The
`TerminalReporter` also needs this, but uses the external `wcwidth`
package.
This commit brings the `TerminalWriter` implementation up-to-par with
`wcwidth`, moves to implementation to a new file `_pytest._io.wcwidth`
which is used everywhere, and removes the dependency.
The differences compared to the `wcwidth` package are:
- Normalizes the string before counting.
- Uses Python's `unicodedata` instead of vendored Unicode tables. This
means the data corresponds to the Python's version Unicode version
instead of the `wcwidth`'s package version.
- Apply some optimizations.
|
|
Fix/improve printing of docs for collected items
|
|
|
|
|
|
functionality
This hook has some functionality to provide explicit markup for the test
status. It seemed unused and wasn't tested, so I was tempted to remove
it, but I found that the pytest-rerunfailures plugin uses it, so
document it and add a test instead.
|
|
* tests: harden test_itemreport_subclasses_show_subclassed_file
* extend test_itemreport_subclasses_show_subclassed_file
|
|
Conflicts:
src/_pytest/terminal.py
testing/test_debugging.py
testing/test_terminal.py
|
|
|
|
* Use code highlighting if pygments is installed
* Use colorama constants instead of bare ascii codes
Could not find the exact equivalent of 'hl-reset' code using colorama
constants though.
* Refactor ASCII color handling into a fixture
* Revert back to using explicit color codes
* In Python 3.5 skip rest of tests that require ordered markup in colored output
|
|
Conflicts:
src/_pytest/main.py
src/_pytest/mark/structures.py
src/_pytest/python.py
testing/test_main.py
testing/test_parseopt.py
|
|
ExitCode is used in several internal modules and hooks and so with type
annotations added, needs to be imported a lot.
_pytest.main, being the entry point, generally sits at the top of the
import tree.
So, it's not great to have ExitCode defined in _pytest.main, because it
will cause a lot of import cycles once type annotations are added (in
fact there is already one, which this change removes).
Move it to _pytest.config instead.
_pytest.main still imports ExitCode, so importing from there still
works, although external users should really be importing from `pytest`.
|
|
Fixes https://github.com/pytest-dev/pytest/pull/4518.
|
|
|
|
terminal: default to `fE` with `-r` (reportchars)
|
|
Adds handling of `N` to reset `reportchars`, which can be used to get
the old behavior (`-rN`), and also allows for an alternative to
`--disable-warnings` (https://github.com/pytest-dev/pytest/issues/5066),
since `w` was included by default (without `--disable-warnings`).
Fixes https://github.com/pytest-dev/pytest/issues/6454
|
|
|
|
|
|
Via https://github.com/pytest-dev/pytest/issues/6574.
|
|
|
|
- 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.
|
|
Conflicts:
* src/_pytest/_code/code.py
* src/_pytest/main.py
* testing/python/metafunc.py
* testing/test_parseopt.py
* testing/test_pytester.py
|
|
|
|
|
|
Make --showlocals work together with --tb=short
Fixes https://github.com/pytest-dev/pytest/issues/494
Ref: https://github.com/pytest-dev/pytest/issues/1715
|
|
|
|
Conflicts:
.github/workflows/main.yml
|