Skip to content

Commit a187aa4

Browse files
author
gdhameeja
committed
Merge branch 'master' into Fix-6906
2 parents 9fc10e6 + d9546ff commit a187aa4

35 files changed

+638
-439
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ Pulkit Goyal
233233
Punyashloka Biswal
234234
Quentin Pradet
235235
Ralf Schmitt
236+
Ram Rachum
236237
Ralph Giles
237238
Ran Benita
238239
Raphael Castaneda

CONTRIBUTING.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,10 @@ Short version
173173
The test environments above are usually enough to cover most cases locally.
174174

175175
#. Write a ``changelog`` entry: ``changelog/2574.bugfix.rst``, use issue id number
176-
and one of ``bugfix``, ``removal``, ``feature``, ``vendor``, ``doc`` or
177-
``trivial`` for the issue type.
176+
and one of ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``,
177+
``breaking``, ``vendor`` or ``trivial`` for the issue type.
178+
179+
178180
#. Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please
179181
add yourself to the ``AUTHORS`` file, in alphabetical order.
180182

@@ -274,8 +276,9 @@ Here is a simple overview, with pytest-specific bits:
274276

275277
#. Create a new changelog entry in ``changelog``. The file should be named ``<issueid>.<type>.rst``,
276278
where *issueid* is the number of the issue related to the change and *type* is one of
277-
``bugfix``, ``removal``, ``feature``, ``vendor``, ``doc`` or ``trivial``. You may not create a
278-
changelog entry if the change doesn't affect the documented behaviour of Pytest.
279+
``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, ``breaking``, ``vendor``
280+
or ``trivial``. You may skip creating the changelog entry if the change doesn't affect the
281+
documented behaviour of pytest.
279282

280283
#. Add yourself to ``AUTHORS`` file if not there yet, in alphabetical order.
281284

changelog/7383.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed exception causes all over the codebase, i.e. use `raise new_exception from old_exception` when wrapping an exception.

changelog/7385.improvement.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
``--junitxml`` now includes the exception cause in the ``message`` XML attribute for failures during setup and teardown.
2+
3+
Previously:
4+
5+
.. code-block:: xml
6+
7+
<error message="test setup failure">
8+
9+
Now:
10+
11+
.. code-block:: xml
12+
13+
<error message="failed on setup with &quot;ValueError: Some error during setup&quot;">

doc/en/example/markers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ Automatically adding markers based on test names
639639

640640
.. regendoc:wipe
641641
642-
If you a test suite where test function names indicate a certain
642+
If you have a test suite where test function names indicate a certain
643643
type of test, you can implement a hook that automatically defines
644644
markers so that you can use the ``-m`` option with it. Let's look
645645
at this test module:

doc/en/talks.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Talks and Tutorials
33
==========================
44

5+
.. sidebar:: Next Open Trainings
6+
7+
- `Free 1h webinar: "pytest: Test Driven Development für Python" <https://mylearning.ch/kurse/online-kurse/tech-webinar/>`_ (German), online, August 18 2020.
8+
- `"pytest: Test Driven Development (nicht nur) für Python" <https://workshoptage.ch/workshops/2020/pytest-test-driven-development-nicht-nur-fuer-python/>`_ (German) at the `CH Open Workshoptage <https://workshoptage.ch/>`_, September 8 2020, HSLU Campus Rotkreuz (ZG), Switzerland.
9+
510
.. _`funcargs`: funcargs.html
611

712
Books

src/_pytest/_code/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .code import getfslineno
77
from .code import getrawcode
88
from .code import Traceback
9+
from .code import TracebackEntry
910
from .source import compile_ as compile
1011
from .source import Source
1112

@@ -17,6 +18,7 @@
1718
"getfslineno",
1819
"getrawcode",
1920
"Traceback",
21+
"TracebackEntry",
2022
"compile",
2123
"Source",
2224
]

src/_pytest/_code/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def statement(self) -> "Source":
213213
return source.getstatement(self.lineno)
214214

215215
@property
216-
def path(self):
216+
def path(self) -> Union[py.path.local, str]:
217217
""" path to the source code """
218218
return self.frame.code.path
219219

src/_pytest/_code/source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def compile( # noqa: F811
215215
newex.offset = ex.offset
216216
newex.lineno = ex.lineno
217217
newex.text = ex.text
218-
raise newex
218+
raise newex from ex
219219
else:
220220
if flag & ast.PyCF_ONLY_AST:
221221
assert isinstance(co, ast.AST)

0 commit comments

Comments
 (0)