Commit Graph

9217 Commits

Author SHA1 Message Date
Daniel Hahler 6dc575f5ee
Merge pull request #4239 from blueyed/lru_cache
Move lru_cache wrapper to compat
2018-10-25 20:09:01 +02:00
Daniel Hahler 0dc6cb298e Move lru_cache wrapper to compat
Ref: https://github.com/pytest-dev/pytest/pull/4227#discussion_r228060373
2018-10-25 18:20:36 +02:00
Bruno Oliveira 041044eef0
Merge pull request #4238 from asottile/cl
Add a changelog for #4235 [ci skip]
2018-10-25 13:14:05 -03:00
Anthony Sottile 1af31a09f4 Add a changelog for #4235 [ci skip] 2018-10-25 09:09:25 -07:00
Daniel Hahler f466105d66
Merge pull request #2619 from blueyed/pdb-resume-capture
pdb: resume capturing after `continue`
2018-10-25 14:28:47 +02:00
Bruno Oliveira ccdb248397
Merge pull request #4235 from asottile/reorder_python_imports
Apply reorder-python-imports to all files
2018-10-25 08:37:40 -03:00
Daniel Hahler ede3a4e850 pytest_{enter,leave}_pdb: pass through pdb instance 2018-10-25 13:28:24 +02:00
Daniel Hahler a4ea66cb1f pdb: resume capturing after `continue`
After `pdb.set_trace()` capturing is turned off.
This patch resumes it after using the `continue` (or `c` / `cont`)
command.

Store _pytest_capman on the class, for pdbpp's do_debug hack to keep it.

Without this, `debug …` would fail like this:

    /usr/lib/python3.6/cmd.py:217: in onecmd
        return func(arg)
    .venv/lib/python3.6/site-packages/pdb.py:608: in do_debug
        return orig_do_debug(self, arg)
    /usr/lib/python3.6/pdb.py:1099: in do_debug
        sys.call_tracing(p.run, (arg, globals, locals))
    /usr/lib/python3.6/bdb.py:434: in run
        exec(cmd, globals, locals)
    /usr/lib/python3.6/bdb.py:51: in trace_dispatch
        return self.dispatch_line(frame)
    /usr/lib/python3.6/bdb.py:69: in dispatch_line
        self.user_line(frame)
    /usr/lib/python3.6/pdb.py:261: in user_line
        self.interaction(frame, None)
    .venv/lib/python3.6/site-packages/pdb.py:203: in interaction
        self.setup(frame, traceback)
    E   AttributeError: 'PytestPdb' object has no attribute '_pytest_capman'

- add pytest_leave_pdb hook
- fixes test_pdb_interaction_capturing_twice: would fail on master now,
  but works here
2018-10-25 13:28:24 +02:00
Anthony Sottile 2368fbb63c Apply reorder-python-imports to all files 2018-10-25 00:01:29 -07:00
Ronny Pfannschmidt f6dfca7182
Merge pull request #4229 from nicoddemus/fix-warning-location
Show node that originated a warning in the warnings summary
2018-10-25 08:26:01 +02:00
Ronny Pfannschmidt 65b97c2f41
Merge pull request #4227 from blueyed/_getconftest_pathlist-lru
Use functools.lru_cache with _getconftest_pathlist
2018-10-25 08:12:51 +02:00
Bruno Oliveira 4a69104af3
Merge pull request #4232 from blueyed/fix-doc-caplog
doc: fix caplog: s/methods/properties/
2018-10-24 19:27:30 -03:00
Bruno Oliveira 1786ad16a7 functools.lru_cache does not exist on Python 2, apply for Python 3 only 2018-10-24 18:59:54 -03:00
Daniel Hahler 2cf4c67e45 doc: fix caplog: s/methods/properties/ 2018-10-24 23:57:11 +02:00
Bruno Oliveira 2ad43ee442 Show node that originated a warning in the warnings summary
Fix #4221
2018-10-24 18:49:53 -03:00
Daniel Hahler 15278aacb9
Merge pull request #4231 from blueyed/fix-master
Fix flake8: os imported, but unused
2018-10-24 23:47:46 +02:00
Daniel Hahler 57caa4e25e Fix flake8: os imported, but unused
Likely due to b6fa4e24.
2018-10-24 23:43:41 +02:00
Daniel Hahler 66ce952da6
Merge pull request #4228 from blueyed/merge-master
Merge master into features
2018-10-24 23:04:52 +02:00
Bruno Oliveira b6fa4e248f
Merge pull request #4028 from asottile/revert_breakpoint_code
Revert patching of breakpointhook as it appears to do nothing
2018-10-24 17:50:19 -03:00
Daniel Hahler eee8201e4f Merge remote-tracking branch 'origin/master' into merge-master 2018-10-24 22:36:34 +02:00
Daniel Hahler e690e191fd
Merge pull request #4225 from blueyed/collect-performance
TerminalWriter: write "collecting" msg only once every 0.5s
2018-10-24 22:35:53 +02:00
Daniel Hahler d40cd3ec6b Use functools.lru_cache with _getconftest_pathlist
For pytest's own suite the `cache_info()` looks as follows:

    > session.config._getconftest_pathlist.cache_info()
    CacheInfo(hits=231, misses=19, maxsize=None, currsize=19)

While it does not really make a difference for me this might help with
larger test suites / the case mentioned in
https://github.com/pytest-dev/pytest/issues/2206#issuecomment-432623646.
2018-10-24 18:22:30 +02:00
Daniel Hahler 9df1b037d6
Merge pull request #4217 from nicoddemus/fix-macos-py37-travis
Fix MacOS py37 on Travis
2018-10-24 17:51:49 +02:00
Bruno Oliveira 28dbffdaf2 Attempt to fix macosx build setup
This has been failing as of 2018-10-23 while installing gcc with
this message:

	==> Installing numpy dependency: gcc
	==> Downloading https://homebrew.bintray.com/bottles/gcc-8.2.0.high_sierra.bottl
	######################################################################## 100.0%
	==> Pouring gcc-8.2.0.high_sierra.bottle.1.tar.gz
	Error: The `brew link` step did not complete successfully
	The formula built, but is not symlinked into /usr/local
	Could not symlink include/c++
	Target /usr/local/include/c++
	already exists. You may want to remove it:
	  rm '/usr/local/include/c++'
	To force the link and overwrite all conflicting files:
	  brew link --overwrite gcc
	To list all files that would be deleted:
	  brew link --overwrite --dry-run gcc
	Possible conflicting files are:
	/usr/local/include/c++ -> /usr/local/Caskroom/oclint/0.13.1,17.4.0/oclint-0.13.1/include/c++
2018-10-24 12:46:45 -03:00
Daniel Hahler f8f4c16020 TerminalWriter: write "collecting" msg only once every 0.1s
Running `pytest -k doesnotmatch` on pytest's own tests takes ~3s with
Kitty terminal for me, but only ~1s with `-q`.
It also is faster with urxvt, but still takes 2.2s there.

This patch only calls `report_collect` every 0.1s, which is good enough
for reporting collection progress, and improves the time with both Kitty
and urxvt to ~1.2s for me.
2018-10-24 16:48:35 +02:00
Bruno Oliveira 8bced7415c
Merge pull request #4220 from anpr/doc_raise_on_empty_parameterset
Add `empty_parameter_set_mark` ini option documentation to the parametrize doc
2018-10-23 19:10:44 -03:00
Bruno Oliveira 72d98a7c52
Merge pull request #4214 from blueyed/fix-4174
Fix "Plugin already registered" error with symlinks
2018-10-23 17:10:15 -03:00
Andreas Profous 0dd85157ea Add reference to ``empty_parameter_set_mark`` parametrize doc 2018-10-23 22:03:05 +02:00
Daniel Hahler 2a45851c9e
Merge pull request #4218 from blueyed/remove-_shutil_rmtree_remove_writable
minor: remove unused _shutil_rmtree_remove_writable
2018-10-23 18:34:28 +02:00
Daniel Hahler b51ee48f78 minor: remove unused _shutil_rmtree_remove_writable 2018-10-23 17:36:22 +02:00
Daniel Hahler fadac0ffc0 Fix "Plugin already registered" error with symlinks
Fixes https://github.com/pytest-dev/pytest/issues/4174.
2018-10-23 10:15:23 +02:00
Anthony Sottile 799b72cf6f
Merge pull request #4213 from asottile/flake8_master_fixes
Fixes for flake8 master
2018-10-22 20:08:38 -07:00
Bruno Oliveira fc0f89ac14
Merge pull request #4215 from nicoddemus/release-3.9.2
Release version 3.9.2
2018-10-22 22:08:16 -03:00
Bruno Oliveira 771e860011 Preparing release version 3.9.2 2018-10-22 21:47:42 +00:00
Anthony Sottile cb39bd0651 Fixes for flake8 master 2018-10-22 08:50:00 -07:00
Anthony Sottile c94b2b227e
Merge pull request #4208 from nicoddemus/pytestskip-docs-4206
Remove pytest.config example from skipping at module level docs
2018-10-21 10:28:53 -07:00
Ankit Goel f30911d3af
Merge pull request #4209 from nicoddemus/fixture-named-request
Issue a warning when a fixture named 'request' is collected
2018-10-21 05:49:08 +05:30
Ankit Goel cd72e23f3f
Merge pull request #4207 from nicoddemus/recursive-dep-fixtures
Improve error message when a recursive dependency between fixtures is detected
2018-10-20 22:19:21 +05:30
Bruno Oliveira 7bb51b8ceb Issue a warning when a fixture named 'request' is collected
Fix #611
2018-10-20 12:09:44 -03:00
Bruno Oliveira b9990f77ff
Merge pull request #4204 from vbarbaresi/3340_log_hooks
Fix logging usage in hooks pytest_sessionstart/finish
2018-10-20 11:36:06 -03:00
Bruno Oliveira 6b126997e1 Remove pytest.config example from skipping at module level docs 2018-10-20 11:28:39 -03:00
Bruno Oliveira 02ae7d8531 Improve error message when a recursive dependency between fixtures is detected
Fix #2909
2018-10-20 09:44:42 -03:00
Bruno Oliveira f947cb2613 Merge remote-tracking branch 'upstream/features' into davidszotten/stepwise 2018-10-20 09:18:02 -03:00
Vincent Barbaresi db106d6085 Fix logging usage in hooks pytest_sessionstart/finish #3340 2018-10-20 09:55:10 +02:00
Bruno Oliveira b0eed7b56c
Merge pull request #4205 from vbarbaresi/fix_typo
fix typo in tmpdir documentation (trivial)
2018-10-19 17:49:32 -03:00
Vincent Barbaresi 51d358a7a9 fix typo in tmpdir documentation 2018-10-19 19:22:04 +02:00
Bruno Oliveira c54cdd05b8
Merge pull request #4201 from ykantor/patch-1
Update tmpdir.rst - very trivial
2018-10-19 12:13:35 -03:00
Bruno Oliveira dde147641e
Fix linting 2018-10-19 09:33:51 -03:00
Bruno Oliveira 2abd005cc9
Merge pull request #4195 from nicoddemus/issue-3691
Use safe_str() to format warning message about unicode in Python 2
2018-10-19 07:18:29 -03:00
Ronny Pfannschmidt 366b88388b
Merge pull request #4200 from asottile/upgrade_hooks
Upgrade pre-commit/pre-commit-hooks to 2.0.0
2018-10-19 08:33:03 +02:00