Commit Graph

10002 Commits

Author SHA1 Message Date
Daniel Hahler 4011021823 pdb: do not raise outcomes.Exit with quit in debug 2019-03-29 11:02:34 +01:00
Daniel Hahler bfda2a0050 setup.cfg: use existing [tool:pytest] (ignoring [pytest]) 2019-03-29 10:59:27 +01:00
Bruno Oliveira 2812c087ec
Merge pull request #5010 from garytyler/docupdate
Update docs for 'pytest_cmdline_parse' hook to note availability limi…
2019-03-28 22:32:50 -03:00
Bruno Oliveira 6b5cddc48a
Merge pull request #4951 from blueyed/fix-pdb-capfix
pdb: handle capturing with fixtures only
2019-03-28 20:34:28 -03:00
Gary Tyler 403f556928 Update docs for 'pytest_cmdline_parse' hook to note availability liminations 2019-03-28 19:25:55 -04:00
Bruno Oliveira d8ef86aadf
Merge pull request #4993 from blueyed/stepwise-report
stepwise: report status via pytest_report_collectionfinish
2019-03-28 20:24:18 -03:00
Bruno Oliveira a9fe1e159a
Merge pull request #4965 from nicoddemus/serialization-hooks
Serialization hooks
2019-03-28 20:22:19 -03:00
Bruno Oliveira 65c8e8a09e Rename hooks: to/from_serializable 2019-03-28 13:41:56 -03:00
Daniel Hahler 46d9243eb0 changelog 2019-03-28 11:56:53 +01:00
Daniel Hahler 63a01bdb33 Factor out pytestPDB._is_capturing 2019-03-28 11:49:01 +01:00
Daniel Hahler d53209956b test_pdb_continue_with_recursive_debug: mock pdb.set_trace 2019-03-28 11:49:01 +01:00
Daniel Hahler 951213ee09 Use new suspend/resume in global_and_fixture_disabled 2019-03-28 11:49:01 +01:00
Daniel Hahler ae067df941 add test_pdb_continue_with_recursive_debug 2019-03-28 11:49:01 +01:00
Daniel Hahler 40718efacc Fix/revisit do_continue with regard to conditions 2019-03-28 11:49:01 +01:00
Daniel Hahler d406786a8d pdb: handle capturing with fixtures only 2019-03-28 11:49:01 +01:00
Daniel Hahler 0ac069da13
Merge pull request #5006 from blueyed/capture-clean
tests: ensure cleanup with configs via get_config()
2019-03-28 11:38:30 +01:00
Daniel Hahler d17ea7a9c0 tests: ensure cleanup with configs via get_config()
Also done in test_pluginmanager, although no resource warnings are
there at least.

Fixes https://github.com/pytest-dev/pytest/issues/4355.
2019-03-28 00:14:13 +01:00
Daniel Hahler c92021fc4f
Merge pull request #5003 from blueyed/off
Fix off-by-one error with lineno in mark collection error
2019-03-28 00:09:53 +01:00
Daniel Hahler 50a5cebba8
Merge pull request #5002 from blueyed/report
skipping: factor out _get_pos, pass only config to _get_report_str
2019-03-27 23:07:11 +01:00
Bruno Oliveira 6c602c2282
Merge pull request #4995 from youknowone/disble_test_id_escaping
add ini option to disable string escape for parametrization
2019-03-27 17:34:35 -03:00
Daniel Hahler 76c70cbf4c Fix off-by-one error with lineno in mark collection error 2019-03-27 17:44:52 +01:00
Bruno Oliveira 3d9e68ecfd Update doc/en/parametrize.rst 2019-03-28 00:07:28 +09:00
Jeong YunWon 8b0b7156d9 Fix glitches of original patch of disable-test-id-escaping 2019-03-28 00:07:28 +09:00
ApaDoctor cf6e2ceafd add ini option to disable string escape for parametrization 2019-03-28 00:07:28 +09:00
Bruno Oliveira 69a55d334a
Merge pull request #5004 from blueyed/doc-pdb
doc: fix note about output capturing with pdb
2019-03-26 20:20:05 -03:00
Bruno Oliveira 241b7433cd
Merge pull request #4978 from blueyed/exit-from-from_assertrepr_compare
Do not swallow outcomes.Exit in assertrepr_compare
2019-03-26 18:39:13 -03:00
Bruno Oliveira 057c97812b
Merge pull request #4975 from blueyed/verbose-fixes
Fix usages of "verbose" option
2019-03-26 18:38:39 -03:00
Bruno Oliveira 02188e399d
Merge pull request #4987 from blueyed/collect-tbstyle-repr_failure
CollectError.repr_failure: honor explicit tbstyle option
2019-03-26 18:37:49 -03:00
Bruno Oliveira aae02863db
Merge pull request #4999 from nicoddemus/cmdline_parse-early
Docs: modules implementing pytest_cmdline_parse can be early-loaded
2019-03-26 18:14:31 -03:00
Daniel Hahler 49f36bb028
Merge pull request #4988 from blueyed/logging-close
logging: close log_file_handler
2019-03-26 19:57:57 +01:00
Daniel Hahler 52730f6330 doc: fix note about output capturing with pdb
[skip travis]
2019-03-26 18:33:00 +01:00
Daniel Hahler 538efef1ba logging: close log_file_handler
While it should be closed in logging's shutdown [1], the following would
still issue a ResourceWarning:

```
import logging

log_file_handler = logging.FileHandler("temp.log", mode="w", encoding="UTF-8")

root_logger = logging.getLogger()
root_logger.addHandler(log_file_handler)
root_logger.removeHandler(log_file_handler)
root_logger.error("error")

del log_file_handler
```

It looks like the weakref might get lost for some reason.

See https://github.com/pytest-dev/pytest/pull/4981/commits/92ffe42b45 / #4981
for more information.

1: c1419578a1/Lib/logging/__init__.py (L2107-L2139)
2019-03-26 18:24:19 +01:00
Bruno Oliveira 9311d822c7 Fix assertion in pytest_report_unserialize 2019-03-26 12:47:31 -03:00
Daniel Hahler 351529cb50 skipping: factor out _get_pos, pass only config to _get_report_str 2019-03-26 16:29:16 +01:00
Daniel Hahler 94a2e3dddc stepwise: report status via pytest_report_collectionfinish 2019-03-26 13:20:33 +01:00
Bruno Oliveira ee96214a8d
Merge pull request #5000 from blueyed/merge-master-into-features
Merge master into features
2019-03-26 09:01:46 -03:00
Daniel Hahler e1ae469504 Merge master into features 2019-03-26 10:23:21 +01:00
Daniel Hahler 0d00be4f4f Do not swallow outcomes.Exit in assertrepr_compare 2019-03-26 10:20:00 +01:00
Daniel Hahler 23146e7527 Fix usages of "verbose" option
With `-qq` `bool(config.getoption("verbose"))` is True; it needs to be
checked for `> 0`.
2019-03-26 10:11:25 +01:00
Daniel Hahler b18df936ea changelog 2019-03-26 10:06:53 +01:00
Daniel Hahler 4148663706
Merge pull request #4979 from blueyed/minor
Minor: whitespace, typo, docs
2019-03-26 10:01:13 +01:00
Bruno Oliveira 3e1971eb16
Merge pull request #4994 from blueyed/test_as_errors-subprocess
test_as_errors: use subprocess with `-W`
2019-03-25 20:50:15 -03:00
Bruno Oliveira bcdb86ee7e
Merge pull request #4991 from blueyed/fix-tests
Fix pytest's own tests with `-W error::ResourceWarning`
2019-03-25 20:47:51 -03:00
Bruno Oliveira 2d77018d1b Improve coverage for _report_unserialization_failure 2019-03-25 20:16:59 -03:00
Bruno Oliveira ceef0af1ae Improve coverage for to_json() with paths in reports 2019-03-25 20:16:59 -03:00
Bruno Oliveira e4eec3416a Note that tests from xdist reference the correct xdist issues 2019-03-25 20:16:59 -03:00
Bruno Oliveira 645774295f Add CHANGELOG 2019-03-25 20:16:59 -03:00
Bruno Oliveira f2e0c740d3 Code review suggestions 2019-03-25 20:16:59 -03:00
Bruno Oliveira d856f4e51f Make sure TestReports are not collected as test classes 2019-03-25 20:16:59 -03:00
Bruno Oliveira 7b9a414524 Add pytest_report_serialize and pytest_report_unserialize hooks
These hooks will be used by pytest-xdist and pytest-subtests to
serialize and customize reports.
2019-03-25 20:16:59 -03:00