Age | Commit message (Collapse) | Author |
|
Fix INTERNALERROR when accessing locals / globals with faulty `exec`
|
|
|
|
|
|
Prepare release 6.0.2
(cherry picked from commit fe69bd5baf6b8d1713e16caffc7a5e8dab63bc0f)
|
|
Fix #1953
|
|
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
|
|
config: start migrating Config.{rootdir,inifile} from py.path.local to pathlib
|
|
Fix handle of exceptions in ReprEntry with tb=line
|
|
properties
|
|
Warnings are a central part of Python, so much that Python itself has
command-line and environtment variables to handle warnings.
By moving the concept of warning handling into Config, it becomes natural to
filter warnings issued as early as possible, even before the "_pytest.warnings"
plugin is given a chance to spring into action. This also avoids the weird
coupling between config and the warnings plugin that was required before.
Fix #6681
Fix #2891
Fix #7620
Fix #7626
Close #7649
Co-authored-by: Ran Benita <ran@unusedvar.com>
|
|
Fix #7707
|
|
When a Python object (module/class/instance) is collected, for each name
in `obj.__dict__` (and up its MRO) the pytest_pycollect_makeitem hook is
called for potentially creating a node for it.
These Python objects have a bunch of builtin attributes that are
extremely unlikely to be collected. But due to their pervasiveness,
dispatching the hook for them ends up being mildly expensive and also
pollutes PYTEST_DEBUG=1 output and such.
Let's just ignore these attributes.
On the pandas test suite commit 04e9e0afd476b1b8bed930e47bf60e,
collect only, irrelevant lines snipped, about 5% improvement:
Before:
```
51195095 function calls (48844352 primitive calls) in 39.089 seconds
ncalls tottime percall cumtime percall filename:lineno(function)
226602/54 0.145 0.000 38.940 0.721 manager.py:90(_hookexec)
72227 0.285 0.000 20.146 0.000 python.py:424(_makeitem)
72227 0.171 0.000 16.678 0.000 python.py:218(pytest_pycollect_makeitem)
```
After:
```
48410921 function calls (46240870 primitive calls) in 36.950 seconds
ncalls tottime percall cumtime percall filename:lineno(function)
181429/54 0.113 0.000 36.777 0.681 manager.py:90(_hookexec)
27054 0.130 0.000 17.755 0.001 python.py:465(_makeitem)
27054 0.121 0.000 16.219 0.001 python.py:218(pytest_pycollect_makeitem)
```
|
|
In ff8b7884e8f1019f60f270eab2c4909ff557dd4e NOTSET was changed to a
singleton enum, which ended up unexpectedly triggering a code path in ID
generation which checks for `isinstance(Enum)`.
Add an explicit case for it, which is not too bad anyway.
|
|
capture: fix disabled()/global_and_fixture_disabled() enabling capturing when it was disabled
|
|
logging: fix handler level restored incorrectly if caplog.set_level is called more than once
|
|
called more than once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Only define gethookproxy, isinitpath on Session
|
|
|
|
when it was disabled
The `CaptureManager.global_and_fixture_disabled()` context manager (and
`CaptureFixture.disabled()` which calls it) did `suspend(); ...;
resume()` but if the capturing was already suspended, the `resume()`
would resume it when it shouldn't.
This caused caused some messages to be swallowed when `--log-cli` is
used because it uses `global_and_fixture_disabled` when capturing is not
necessarily resumed.
|
|
Fix #7628
|
|
|
|
This fixes an issue where pylint complains about missing implementations
of abstract methods in subclasses of `File` which only override
`collect()` (as they should).
It is also cleaner and makes sense, these methods really don't need to
be overridden.
The previous methods defined directly on `FSCollector` and `Package` are
deprecated, to be removed in pytest 7.
See commits e2934c3f8c03c83469f4c6670c207773a6e02df4 and
f10ab021e21a44e2f0fa2be66660c4a6d4b7a61a for reference.
|
|
|
|
Fix #7638
|
|
|
|
Merge pull request #7584 from pytest-dev/release-6.0.1
|
|
We barely use it; the couple places that do are not really worth the
extra dependency, I think the code is clearer without it.
Also simplifies one (regular) itertools usage.
Also improves a check and an error message in `pytest.raises`.
|
|
Prepare release 6.0.1
(cherry picked from commit 022bff27a71406bd5dc4794d34f1fbbf56a45250)
|
|
|
|
fix-changelog-entries-release-process
|
|
|
|
|
|
Fix #7559
|
|
junitxml: convert from py.xml to xml.etree.ElementTree
|
|
mark: fix pylint not-callable error on pytest.mark.parametrize(...), again
(cherry picked from commit f9837f953c03268baa4ae8e9803cb3a13ec6860c)
|
|
mark: fix pylint not-callable error on pytest.mark.parametrize(...), again
|
|
Part of the effort to reduce dependency on the py library.
Besides that, py.xml implements its own XML serialization which is
pretty scary.
I tried to keep the code with minimal changes (though it could use some
cleanups). The differences in behavior I have noticed are:
- Attributes in the output are not sorted.
- Some unneeded escaping is no longer performed, for example escaping
`"` to `"` in a text node.
|
|
(#7427)
|
|
Apparently the previous fix c1ca42b5c264b4ea1b4591bc12e0 didn't work.
Hopefully this time I'm testing this correctly.
|
|
|
|
* Revert change to traceback repr
* Add test and changelog entry
* Restore *exact* prev output
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
|
|
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|