Commit Graph

11434 Commits

Author SHA1 Message Date
Daniel Hahler eb7a4e32ad saferepr: handle BaseExceptions
This causes INTERNALERRORs with pytest-django, which uses
`pytest.fail` (derived from `BaseException`) to prevent DB access, when
pytest then tries to e.g. display the `repr()` for a Django `QuerySet`
etc.

Ref: https://github.com/pytest-dev/pytest-django/pull/776
2019-11-06 22:08:10 +01:00
Daniel Hahler 5be3a9b5ce
tests: speed up test_faulthandler.test_timeout (#6075) 2019-11-06 22:07:28 +01:00
Daniel Hahler fe429d4ce8
assert: fix _compare_eq_iterable: re-format both sides (#6137) 2019-11-06 22:06:39 +01:00
Steffen Schroeder ceeb7bd085 Fixed broken links 2019-11-06 20:54:41 +01:00
Steffen Schroeder 1cecdf6619 Added checklinks to tox and release.py 2019-11-06 20:54:41 +01:00
Bruno Oliveira 5738d189a4
[RDY] tox: remove platform restriction, only used for pexpect (#6068)
[RDY] tox: remove platform restriction, only used for pexpect
2019-11-06 16:09:27 -03:00
Bruno Oliveira 85288b5321
fix bug with nonskipped first test in package (#5831)
fix bug with nonskipped first test in package
2019-11-06 16:06:46 -03:00
Bruno Oliveira 74f4ec5986
Making it possible to access the pluginmanager in the pytest_ad… (#6106)
Making it possible to access the pluginmanager in the pytest_addoptio…
2019-11-06 15:18:59 -03:00
Daniel Hahler 8dcee39ce9
Merge pull request #6103 from blueyed/lsof_check
tests: lsof_check: include exc with skip message
2019-11-06 18:44:19 +01:00
Daniel Hahler 4e45472405 Merge master into features
Conflicts:
	src/_pytest/debugging.py
2019-11-06 14:22:07 +01:00
Daniel Hahler 92b436c938
Merge pull request #6136 from blueyed/fix-rm_rf-tests
Fix rm_rf tests
2019-11-06 14:19:47 +01:00
Daniel Hahler 5f9db8a017
Merge pull request #6138 from blueyed/ci-py38
ci: Travis: remove py38 from allowed failures; do not use "-dev"
2019-11-06 14:19:14 +01:00
Daniel Hahler 01769b141a
Merge pull request #6100 from blueyed/fix-skip-offset
terminal: fix line offset with skip reports
2019-11-06 13:29:40 +01:00
Daniel Hahler 0485b07ff0
Merge pull request #6071 from blueyed/tests-doctest-mock
Tests: approx: mock doctest runner's pdb usage
2019-11-06 13:27:50 +01:00
Daniel Hahler eb4b3ce1c8
Merge pull request #6084 from blueyed/merge-rm
tests: merge/remove test_dontreadfrominput_buffer_python3
2019-11-06 13:24:47 +01:00
Daniel Hahler 9071a2a5e0
Merge pull request #6119 from blueyed/FSCollector-fspath
FSCollector: keep/use given fspath
2019-11-06 13:10:27 +01:00
Daniel Hahler 957adbbbc7 ci: Travis: remove py38 from allowed failures; do not use "-dev" 2019-11-06 13:09:11 +01:00
Daniel Hahler ce3d431002 assert: fix _compare_eq_iterable: re-format both sides
Follow-up to 946434c61 (#5924).

Before this patch the test would look like this:

    {'env': {'sub...s wrapped'}}}} == {'env': {'sub...}}}, 'new': 1}
    Omitting 1 identical items, use -vv to show
    Right contains 1 more item:
    {'new': 1}
    Full diff:
      {
       'env': {'sub': {'long_a': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
    -                  'sub1': {'long_a': 'substring '
    +                  'sub1': {'long_a': 'substring that gets wrapped'}}},
    ?                                                +++++++++++++++++ ++++
    +  'new': 1,
    -                                     'that '
    -                                     'gets '
    -                                     'wrapped'}}},
      }
2019-11-06 11:23:15 +01:00
Daniel Hahler e7320c6b54
Merge pull request #5926 from AtakamaLLC/optional-multiline
Add log-auto-indent option to control multiline formatting
2019-11-06 00:35:24 +01:00
Daniel Hahler 00f67494e5
Merge pull request #6107 from MarcoGorelli/color-percentage-indicator
Color percentage indicator
2019-11-06 00:28:45 +01:00
Daniel Hahler d8096925fa Fix for Python 3.5 not handling LocalPath 2019-11-06 00:22:46 +01:00
Daniel Hahler 9309ae299a Use try/finally to ensure chmod is run, filter warning 2019-11-05 22:28:32 +01:00
Daniel Hahler dc2c51302a Revert "tests: filterwarnings: do not crash with "(rm_rf)" warning"
This reverts commit 6b2bae9392.
2019-11-05 22:11:56 +01:00
Tibor Arpas 262ed567d0 tests: clean up chmod-related tests to fix rm_rf warnings
Fixed https://github.com/pytest-dev/pytest/issues/5974#issuecomment-549822509.
2019-11-05 22:10:27 +01:00
Daniel Hahler 0794289689
Merge pull request #6129 from blueyed/typing
Typing around Node.location, reportinfo, repr_excinfo etc
2019-11-05 18:29:29 +01:00
Daniel Hahler cab29dc861
Merge pull request #6124 from blueyed/test_group_warnings_by_message-ignore-own-warning
test_group_warnings_by_message: ignore own PytestExperimentalApiWarning
2019-11-05 16:24:10 +01:00
Daniel Hahler 741f0fedd1 typing around Node.location, reportinfo, repr_excinfo etc 2019-11-05 16:22:58 +01:00
Florian Bruhin 990d75b7e6
Merge pull request #6134 from zmhassan/small_bug1
Removing variable being reassigned
2019-11-05 10:17:04 +01:00
Zak Hassan f9e3a5395c Removing variable being reassigned 2019-11-04 21:11:54 -05:00
MarcoGorelli 0d79061432 Color percentage indicator according to color of final line
indicate current outcome/status with color of percentage indicator

Fix type annotation, refactor _write_progress_information_filling_space

Keep code in _get_main_color as similar as possible to how it was before

Write test

Make black-compliant

Fix error in newly introduced test_collecterror

Make tests more readable by using constants and f-strings

Remove accidentally added monkeypatch

Make Python 3.5-compatible, add changelog entry

Add newline at the end of changelog file
2019-11-04 19:57:07 +00:00
Bruno Oliveira 0760406480
update chanelog link to moved pip docs page (#6127)
update chanelog link to moved pip docs page
2019-11-04 13:18:09 -03:00
Daniel Hahler d53794f916
Merge pull request #6125 from blueyed/upstream-test_terminal-fulltrace
test_terminal: reduce number of tests (single --fulltrace param)
2019-11-04 11:50:18 +01:00
David Szotten 14580c7e31 update chanelog link to moved pip docs page 2019-11-04 10:05:05 +00:00
Ran Benita 08c25b7fe0
Merge pull request #6122 from bluetech/type-annotations-6
Add type annotations to _pytest._io.saferepr and _pytest.assertion.util._diff_text
2019-11-04 09:58:09 +02:00
Daniel Hahler 9f800b2a77 test_terminal: reduce number of tests (single --fulltrace param)
Remove the `--fulltrace` arg from the `Option` fixture used in several
tests, but not checked for.  Only use it with `test_keyboard_interrupt`.

(removes 8 tests, coverage not affected)
2019-11-03 21:23:18 +01:00
Daniel Hahler 68dbc24dcb test_group_warnings_by_message: ignore own PytestExperimentalApiWarning 2019-11-03 21:14:24 +01:00
Ran Benita 7d3ce374d2 Add type annotations to _pytest.assertion.util 2019-11-03 20:28:43 +02:00
Ran Benita 18d181fa77 Remove dead code in _pytest.assertion.util._diff_text
The function handles bytes input, however that is never used.
The function has two callers:

1)

```
            if istext(left) and istext(right):
                explanation = _diff_text(left, right, verbose
```

`istext` checks `isinstance(str)`.

2)

```
def _notin_text(term: str, text: str, verbose: int = 0) -> List[str]:
    ...
    diff = _diff_text(correct_text, text, verbose
```

and `_notin_text` is called once:

```
            if istext(left) and istext(right):
                explanation = _notin_text(left, right, verbose
```
2019-11-03 20:28:43 +02:00
Ran Benita dc30d78845 Add type annotations to _pytest._io.saferepr 2019-11-03 20:28:43 +02:00
MarcoGorelli 9303de877a Fix error in newly introduced test_collecterror
Via https://github.com/pytest-dev/pytest/pull/6107.

(cherry picked from commit 1b9fbbfa195aa20c48574265935dc5e66b96ec16)
2019-11-03 18:16:46 +01:00
Daniel Hahler 3fb969897a
Merge pull request #6059 from blueyed/collect-error-short-summary
terminal: report collection errors as "ERROR" in short summary
2019-11-02 15:34:12 +01:00
Daniel Hahler 6df4d07a57
Merge pull request #6067 from blueyed/harden-test
tests: harden test_disabled_capture_fixture
2019-11-02 15:33:55 +01:00
Bruno Oliveira 0947ecd6f0
Change 5924 and 5936 changelog entries to improvement (#6065)
Change 5924 and 5936 changelog entries to improvement
2019-11-02 11:23:06 -03:00
Daniel Hahler 0c7c26fe6e FSCollector: keep/use given fspath
Via https://github.com/blueyed/pytest/pull/42.
2019-11-02 10:02:23 +01:00
Florian Bruhin 35800a2f73
Merge pull request #6112 from gaucheph/fix-small-typo
typos
2019-11-01 11:18:06 +01:00
Patrick Harmon abc890079f typos 2019-10-31 23:19:35 -05:00
Daniel Hahler dc5a4fbe23
Merge pull request #6099 from davidszotten/trace_parametrize
Fix --trace for parametrized tests
2019-11-01 05:06:26 +01:00
David Szotten 285524c6cd Fix --trace for parametrized tests
Without this, the second time it tries to stop in a parametrized
function it raises instead:

`ValueError: --trace can't be used with a fixture named func!`

Implementation idea, test (and changelog tweaks) thanks to blueyed

Co-Authored-By: Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
Co-Authored-By: Daniel Hahler <git@thequod.de>
2019-10-31 21:41:33 +00:00
Daniel Hahler 7f851a215b
Merge pull request #6032 from blueyed/ci-branches
ci: Travis: configure/restrict branch builds
2019-10-31 10:38:01 +01:00
Joshua Storck f400804206 Removing pluginmanager as parameter in definition of pytest_addoption hook 2019-10-30 16:25:50 -04:00