Commit Graph

9001 Commits

Author SHA1 Message Date
Anders Hovmöller 2b50911c9d Minor refactor for readability
Time: 5.73s => 5.88s/5.82s
2018-11-02 17:42:53 +01:00
Anders Hovmöller a41820fbf0 collection: performance: use optimized parts function
Time: 8.53s => 5.73s
2018-11-02 17:42:53 +01:00
Bruno Oliveira f2cebce2eb
Merge pull request #4272 from blueyed/cache-non-default
cacheprovider: display cachedir also in non-verbose mode if customized
2018-11-01 12:19:21 -03:00
Daniel Hahler a192e6b430
Merge pull request #4247 from blueyed/lru
_getconftestmodules: use functools.lru_cache
2018-11-01 15:55:38 +01:00
Daniel Hahler f8a2452247 changelog [ci skip] 2018-11-01 15:53:31 +01:00
Bruno Oliveira 017e504a11
Merge pull request #4277 from blueyed/pdb-set_trace-capture-msg
pdb: improve msg about output capturing with set_trace
2018-10-31 21:48:47 -03:00
Daniel Hahler ce1cc3dddb _getconftestmodules: use functools.lru_cache
Also renames `_path2confmods` to `_dirpath2confmods` for clarity (it is
expected to be a dirpath in `_importconftest`).

Uses an explicit maxsize, since it appears to be only relevant for a
short period [1].

Removes the lru_cache on _getconftest_pathlist, which makes no
difference when caching _getconftestmodules, at least with the
performance test of 100x10 files (#4237).

1: https://github.com/pytest-dev/pytest/pull/4237#discussion_r228528007
2018-10-31 23:17:05 +01:00
Daniel Hahler 65817dd797 changelog [ci skip] 2018-10-31 23:13:25 +01:00
Daniel Hahler e0038b82f7 pdb: improve msg about output capturing with set_trace
Do not display "IO-capturing turned off/on" when ``-s`` is used to avoid
confusion.
2018-10-31 17:09:01 +01:00
Daniel Hahler 1f1d4aaf68 cacheprovider: display cachedir also in non-verbose mode if customized 2018-10-30 23:09:54 +01:00
Bruno Oliveira 233c2a23de
Merge pull request #4250 from blueyed/ignore-pyc
collection: _recurse: skip __pycache__
2018-10-30 08:25:57 -03:00
Daniel Hahler 40228fce5a collection: _recurse: skip __pycache__ 2018-10-30 02:34:32 +01:00
Ronny Pfannschmidt cc531a1ca9
Merge pull request #4253 from nicoddemus/merge-master-into-features
Merge master into features
2018-10-28 10:13:08 +01:00
Bruno Oliveira 3b7fbcd47f Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-10-27 14:29:01 -03:00
Bruno Oliveira 9ef23b686c
Merge pull request #4252 from nicoddemus/release-3.9.3
Preparing release version 3.9.3
2018-10-27 13:36:42 -03:00
Bruno Oliveira 96784c2052 Preparing release version 3.9.3 2018-10-27 13:07:54 +00:00
Ronny Pfannschmidt 9fe871016d
Merge pull request #4147 from davidszotten/stepwise
Stepwise
2018-10-27 15:05:05 +02:00
Bruno Oliveira e986d06ade
Merge pull request #4251 from blueyed/python-collect
python: collect: revisit
2018-10-27 10:02:23 -03:00
Bruno Oliveira ebba3ebe67
Merge pull request #4240 from RonnyPfannschmidt/perf-example-collect-files
add script to generate a example folder for collecting many files
2018-10-26 19:19:02 -03:00
Ankit Goel 1d09e1d8ce
Merge pull request #4248 from jdufresne/binary-type
Remove use of unnecessary compat shim, six.binary_type
2018-10-27 00:03:16 +05:30
Bruno Oliveira d59786fcc4
Merge pull request #4222 from RonnyPfannschmidt/pathlib-fixes
handle race condition when creation and deletion of a numbered dir overlap
2018-10-26 14:36:43 -03:00
Ankit Goel af34164858
Fix changelog file extension 2018-10-26 22:03:57 +05:30
Daniel Hahler dcdf86ef5b python: collect: revisit 2018-10-26 16:06:37 +02:00
Jon Dufresne 167e9b954a Remove use of unnecessary compat shim, six.binary_type
The type `bytes` is available on all supported Python versions. On
Python 2.7, it is an alias of str, same as six.binary_type.

Makes the code slightly more forward compatible.
2018-10-26 06:27:50 -07:00
Daniel Hahler 9cde67c09c
Merge pull request #4224 from blueyed/_getconftestmodules
_getconftestmodules: avoid isfile()/dirpath()
2018-10-26 14:44:46 +02:00
Ronny Pfannschmidt ae2fc27799 handle test folder cleanup being unable to create a cleanup lock 2018-10-26 14:31:54 +02:00
Bruno Oliveira 56989a8350
Merge pull request #4244 from RonnyPfannschmidt/fix-4243
fix #4243 - support positional argument stacklevel on python2
2018-10-26 08:09:33 -03:00
Bruno Oliveira 8d0e1a99e4
Merge pull request #4241 from blueyed/move-duplicates
Move handling of duplicate files
2018-10-26 08:07:48 -03:00
Ronny Pfannschmidt ce0b0518c7 fix #4243 - support positional argument stacklevel on python2 2018-10-26 09:01:25 +02:00
Ronny Pfannschmidt bf19917537
Merge pull request #4242 from pytest-dev/merge-master
merge master into features
2018-10-26 07:21:59 +02:00
Anthony Sottile 777e9e1e17 Merge remote-tracking branch 'origin/master' into merge-master 2018-10-25 18:00:39 -07:00
Ronny Pfannschmidt bfa1993840 add script to generate a example folder for collecting many files 2018-10-25 22:07:20 +02:00
Daniel Hahler e041823643 Move handling of duplicate files
This removes the hack added in https://github.com/pytest-dev/pytest/pull/3802.

Adjusts test:

- it appears to not have been changed to 7 intentionally.
- removes XXX comment, likely not relevant anymore since 6dac7743.
2018-10-25 20:48:08 +02:00
Daniel Hahler 63691f5656 _getconftestmodules: avoid isfile()/dirpath()
Ref: https://github.com/pytest-dev/pytest/issues/2206#issuecomment-432623646
2018-10-25 20:25:07 +02:00
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