summaryrefslogtreecommitdiff
path: root/testing/test_terminal.py
AgeCommit message (Collapse)Author
2021-01-01reports: BaseReport.{passed,failed,skipped} more friendly to mypyRan Benita
Not smart enough to understand the previous code.
2020-12-15terminal: fix "(<Skipped instance>)" skip reason in test status lineRan Benita
2020-12-15hookspec: add pathlib.Path alternatives to py.path.local parameters in hooksRan Benita
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.
2020-12-12terminal: when the skip/xfail is empty, don't show it as "()"Ran Benita
Avoid showing a line like x.py::test_4 XPASS () [100%] which looks funny.
2020-12-09Show reason for skipped test in verbose modeKatarzyna
2020-12-08Migrate to pytester: test_capture.py, test_terminal.py, approx.py (#8108)Anton
* 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
2020-11-08Improve summary stats when using '--collect-only' (#7875)Hugo Martins
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-10-25testing: use pytester.spawn instead of testdirRan Benita
Part of investigating a bug, but didn't fix it.
2020-10-03py36+: pyupgrade: py36+Anthony Sottile
2020-10-03py36+: remove rexport of Path and PurePathAnthony Sottile
2020-10-03Merge pull request #7817 from bluetech/fix-testpaths-bestrelpath2Ran Benita
terminal: fix crash in header reporting when absolute testpaths is used
2020-10-02py36+: remove requires_ordered_markupAnthony Sottile
2020-09-29terminal: fix crash in header reporting when absolute testpaths is usedRan Benita
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.
2020-09-04Replace some usages of config.{rootdir,inifile} with config.{rootpath,inipath}Ran Benita
2020-08-15Refactor Session._parsearg into a separate function for testingBruno Oliveira
2020-08-03testing: fix some docstring issuesRan Benita
In preparation for enforcing some docstring lints.
2020-08-01typing: set disallow_any_genericsRan Benita
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-07-10Remove no longer needed `noqa: F821` usesRan Benita
Not needed since pyflakes 2.2.0.
2020-06-08Fixed testpiotrhm
2020-06-08Fixed linting 2piotrhm
2020-06-08Fixed lintingpiotrhm
2020-06-08Added testspiotrhm
2020-06-08Add pyproject.toml support (#7247)Bruno Oliveira
2020-06-05Enable check_untyped_defs mypy option for testing/ tooRan Benita
2020-05-26Improve our own wcwidth implementation and remove dependency on wcwidth packageRan Benita
`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.
2020-05-05Merge pull request #7064 from blueyed/fix-_printcollecteditems-doc-upstreamRan Benita
Fix/improve printing of docs for collected items
2020-04-17Issue 4677 - always relative path in skip report (#6953)Katarzyna Król
2020-04-09Fix/improve printing of docs for collected itemsDaniel Hahler
2020-04-04Document the pytest_report_teststatus hook better and test uncovered ↵Ran Benita
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.
2020-02-21tests: harden/improve test_itemreport_subclasses_show_subclassed_file (#6467)Daniel Hahler
* tests: harden test_itemreport_subclasses_show_subclassed_file * extend test_itemreport_subclasses_show_subclassed_file
2020-02-15Merge branch 'master' into term-colorDaniel Hahler
Conflicts: src/_pytest/terminal.py testing/test_debugging.py testing/test_terminal.py
2020-02-15tests: harden test_xdist_verbose (#6700)Daniel Hahler
2020-02-12Use code highlighting if pygments is installed (#6658)Bruno Oliveira
* 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
2020-02-11Merge remote-tracking branch 'upstream/master' into mmBruno Oliveira
Conflicts: src/_pytest/main.py src/_pytest/mark/structures.py src/_pytest/python.py testing/test_main.py testing/test_parseopt.py
2020-02-10Move ExitCode's definition from _pytest.main to _pytest.configRan Benita
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`.
2020-02-04testing/conftest.py: testdir: set PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 (#6655)Daniel Hahler
Fixes https://github.com/pytest-dev/pytest/pull/4518.
2020-01-30Merge master into featuresDaniel Hahler
2020-01-29Merge pull request #6524 from blueyed/reportchars-defaultDaniel Hahler
terminal: default to `fE` with `-r` (reportchars)
2020-01-29terminal: default to `fE` with `-r` (reportchars)Daniel Hahler
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
2020-01-28tests: harden test_teardown_many_verboseDaniel Hahler
2020-01-28Merge master into featuresDaniel Hahler
2020-01-26tests: add test_via_execDaniel Hahler
Via https://github.com/pytest-dev/pytest/issues/6574.
2020-01-25typing for test_summary_statsDaniel Hahler
2020-01-25_get_main_color: no yellow ("boring") for non-last itemDaniel Hahler
- 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.
2020-01-22Merge remote-tracking branch 'upstream/master' into mmBruno Oliveira
Conflicts: * src/_pytest/_code/code.py * src/_pytest/main.py * testing/python/metafunc.py * testing/test_parseopt.py * testing/test_pytester.py
2020-01-18tests: terminal: harden/improve test_color_yesDaniel Hahler
2020-01-18test_terminal: improve color handlingDaniel Hahler
2020-01-16Merge pull request #6384 from pv/showlocals-shortDaniel Hahler
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
2020-01-16tests: cleanup unused fixturesDaniel Hahler
2020-01-16Merge master into featuresDaniel Hahler
Conflicts: .github/workflows/main.yml