Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: pytest-dev/pytest
Choose a Base Repository
pytest-dev/pytest
3h4x/pytest
AiOO/pytest
Bachmann1234/pytest
Bjwebb/pytest
Carreau/pytest
CoolCloud/pytest
Elizaveta239/pytest
FirePing32/pytest
Haibo-Wang-ORG/pytest
JaakkoTulkki/pytest
Jacklibobo/pytest
JanAdamiak/pytest
JosiasAurel/pytest
KangarooCreativeTeam/pytest
LaserPhaser/pytest
LeeKamentsky/pytest
MengJueM/pytest
MichaelAquilina/pytest
NEWMANHA/pytest
NeronNeron/pytest
RedBeardCode/pytest
RonnyPfannschmidt/pytest
Sup3rGeo/pytest
Toilal/pytest
WoLpH/pytest
Zac-HD/pytest
Zearin/pytest
abusalimov/pytest
aivizionz/pytest
alertisme/pytest
alex/pytest
allankilpatrick/pytest
amfarrell/pytest
amueller/pytest
anntzer/pytest
aostr/pytest
appneta/pytest
asdlele/pytest
aselus-hub/pytest
asottile/pytest
asvetlov/pytest
axil/pytest
azenk/pytest
b-jazz/pytest
bbs598598/pytest
benauthor/pytest
biern/pytest
blubber/pytest
blueyed/pytest
bubenkoff/pytest
bukzor/pytest
caot/pytest
chaosgeek/pytest
chiller/pytest
chmeldax/pytest
codewarrior0/pytest
cpommranz/pytest
curzona/pytest
davehunt/pytest
davidszotten/pytest
dbzm/pytest
demianbrecht/pytest
diegorusso/pytest
dmerejkowsky/pytest
doomb0t/pytest
ducs-personal/pytest
eli-b/pytest
embray/pytest
enkoder/pytest
eolo999/pytest
esiegerman/pytest
fbessho/pytest
fengxx/pytest
flub/pytest
fudp/pytest
gabrielcnr/pytest
gdyuldin/pytest
gnprice/pytest
goodboy/pytest
gprasad84/pytest
graingert/pytest
grigouze/pytest
gsnedders/pytest
guyzmo/pytest
hackebrot/pytest
happyspace/pytest
hartym/pytest
helenst/pytest
hpk42/pytest
hunse/pytest
iCodeIN/pytest
inirudebwoy/pytest
intermezzo-fr/pytest
ioggstream/pytest
ionelmc/pytest
irachex/pytest
jab/pytest
javiromero/pytest
jb098/pytest
jeanconn/pytest
jenisys/pytest
jessingrass/pytest
jgehrcke/pytest
jjanczyszyn/pytest
joguSD/pytest
jonathanburns/pytest
jugmac00/pytest
k4rtik/pytest
kalekundert/pytest
kevincox/pytest
kracekumar/pytest
lavacat/pytest
lijie1005/pytest
liuweihere/pytest
lukmdo/pytest
luzfcb/pytest
m3talstorm/pytest
macrotim/pytest
malinoff/pytest
manuphatak/pytest
marscher/pytest
matthewshim/pytest
matthiasha/pytest
mbachry/pytest
mbirtwell/pytest
mbyt/pytest
mdaffern/pytest
mdboom/pytest
mehdy/pytest
mgedmin/pytest
mgeier/pytest
mhils/pytest
moagstar/pytest
mommeetcoffee/pytest
mouseratti/pytest
mvoitko/pytest
naveenkumar-grofers/pytest
nayyarv/pytest
nchammas/pytest
netme/pytest
nirs/pytest
novas0x2a/pytest
offbyone/pytest
ojake/pytest
okken/pytest
oleg-alexandrov/pytest
olegpidsadnyi/pytest
oybin1989/pytest
pakal/pytest
pauloxnet/pytest
pelme/pytest
prusse-martin/pytest
quodlibetor/pytest
raquel-ucl/pytest
refi64/pytest
rmfitzpatrick/pytest
roolebo/pytest
rygwdn/pytest
s0undt3ch/pytest
sam-m888/pytest
saxix/pytest
schipiga/pytest
sdementen/pytest
sebastinas/pytest
shoaib-s/pytest
shoyer/pytest
sidhuiklaq/pytest
simudream/pytest
skylarjhdownes/pytest
srinivasreddy/pytest
suzaku/pytest
takluyver/pytest
tamasgal/pytest
tareqalayan/pytest
tbekolay/pytest
thedrow/pytest
timnon/pytest
ting81/pytest
tomviner/pytest
txomon/pytest
uSpike/pytest
ulope/pytest
untitaker/pytest
userzimmermann/pytest
victorliun/pytest
vladimirlagunov/pytest
vodik/pytest
vovanbo/pytest
vpyvovarov/pytest
wanam/pytest
wfxiang08/pytest
xavfernandez/pytest
xianglove/pytest
xtryaii/pytest
yoloseem/pytest
yzdx0000/pytest
zancas/pytest
zhangjuncare/pytest
zhuyafang-hn/pytest
Nothing to show
base: 6.0.1
head repository: pytest-dev/pytest
Choose a Head Repository
pytest-dev/pytest
3h4x/pytest
AiOO/pytest
Bachmann1234/pytest
Bjwebb/pytest
Carreau/pytest
CoolCloud/pytest
Elizaveta239/pytest
FirePing32/pytest
Haibo-Wang-ORG/pytest
JaakkoTulkki/pytest
Jacklibobo/pytest
JanAdamiak/pytest
JosiasAurel/pytest
KangarooCreativeTeam/pytest
LaserPhaser/pytest
LeeKamentsky/pytest
MengJueM/pytest
MichaelAquilina/pytest
NEWMANHA/pytest
NeronNeron/pytest
RedBeardCode/pytest
RonnyPfannschmidt/pytest
Sup3rGeo/pytest
Toilal/pytest
WoLpH/pytest
Zac-HD/pytest
Zearin/pytest
abusalimov/pytest
aivizionz/pytest
alertisme/pytest
alex/pytest
allankilpatrick/pytest
amfarrell/pytest
amueller/pytest
anntzer/pytest
aostr/pytest
appneta/pytest
asdlele/pytest
aselus-hub/pytest
asottile/pytest
asvetlov/pytest
axil/pytest
azenk/pytest
b-jazz/pytest
bbs598598/pytest
benauthor/pytest
biern/pytest
blubber/pytest
blueyed/pytest
bubenkoff/pytest
bukzor/pytest
caot/pytest
chaosgeek/pytest
chiller/pytest
chmeldax/pytest
codewarrior0/pytest
cpommranz/pytest
curzona/pytest
davehunt/pytest
davidszotten/pytest
dbzm/pytest
demianbrecht/pytest
diegorusso/pytest
dmerejkowsky/pytest
doomb0t/pytest
ducs-personal/pytest
eli-b/pytest
embray/pytest
enkoder/pytest
eolo999/pytest
esiegerman/pytest
fbessho/pytest
fengxx/pytest
flub/pytest
fudp/pytest
gabrielcnr/pytest
gdyuldin/pytest
gnprice/pytest
goodboy/pytest
gprasad84/pytest
graingert/pytest
grigouze/pytest
gsnedders/pytest
guyzmo/pytest
hackebrot/pytest
happyspace/pytest
hartym/pytest
helenst/pytest
hpk42/pytest
hunse/pytest
iCodeIN/pytest
inirudebwoy/pytest
intermezzo-fr/pytest
ioggstream/pytest
ionelmc/pytest
irachex/pytest
jab/pytest
javiromero/pytest
jb098/pytest
jeanconn/pytest
jenisys/pytest
jessingrass/pytest
jgehrcke/pytest
jjanczyszyn/pytest
joguSD/pytest
jonathanburns/pytest
jugmac00/pytest
k4rtik/pytest
kalekundert/pytest
kevincox/pytest
kracekumar/pytest
lavacat/pytest
lijie1005/pytest
liuweihere/pytest
lukmdo/pytest
luzfcb/pytest
m3talstorm/pytest
macrotim/pytest
malinoff/pytest
manuphatak/pytest
marscher/pytest
matthewshim/pytest
matthiasha/pytest
mbachry/pytest
mbirtwell/pytest
mbyt/pytest
mdaffern/pytest
mdboom/pytest
mehdy/pytest
mgedmin/pytest
mgeier/pytest
mhils/pytest
moagstar/pytest
mommeetcoffee/pytest
mouseratti/pytest
mvoitko/pytest
naveenkumar-grofers/pytest
nayyarv/pytest
nchammas/pytest
netme/pytest
nirs/pytest
novas0x2a/pytest
offbyone/pytest
ojake/pytest
okken/pytest
oleg-alexandrov/pytest
olegpidsadnyi/pytest
oybin1989/pytest
pakal/pytest
pauloxnet/pytest
pelme/pytest
prusse-martin/pytest
quodlibetor/pytest
raquel-ucl/pytest
refi64/pytest
rmfitzpatrick/pytest
roolebo/pytest
rygwdn/pytest
s0undt3ch/pytest
sam-m888/pytest
saxix/pytest
schipiga/pytest
sdementen/pytest
sebastinas/pytest
shoaib-s/pytest
shoyer/pytest
sidhuiklaq/pytest
simudream/pytest
skylarjhdownes/pytest
srinivasreddy/pytest
suzaku/pytest
takluyver/pytest
tamasgal/pytest
tareqalayan/pytest
tbekolay/pytest
thedrow/pytest
timnon/pytest
ting81/pytest
tomviner/pytest
txomon/pytest
uSpike/pytest
ulope/pytest
untitaker/pytest
userzimmermann/pytest
victorliun/pytest
vladimirlagunov/pytest
vodik/pytest
vovanbo/pytest
vpyvovarov/pytest
wanam/pytest
wfxiang08/pytest
xavfernandez/pytest
xianglove/pytest
xtryaii/pytest
yoloseem/pytest
yzdx0000/pytest
zancas/pytest
zhangjuncare/pytest
zhuyafang-hn/pytest
Nothing to show
compare: 6.1.0
Commits on Jul 24, 2020
Part of reducing dependency on `py`. Also enables upcoming improvements.

In cases where there are simpler alternatives (in tests), I used those.

What's left are a couple of uses in `_pytest.main` and `_pytest.python`
and they only have modest requirements, so all of the featureful code
from py is not needed.
`os.scandir()`, introduced in Python 3.5, is much faster than
`os.listdir()`. See https://www.python.org/dev/peps/pep-0471/.

It also has a `DirEntry` which can be used to further reduce syscalls in
some cases.
Commits on Jul 28, 2020
The links were still pointing to the latest version (instead of stable)
and also took the opportunity to update the text a bit.
Commits on Jul 29, 2020
Merge pull request #7550 from pytest-dev/release-6.0.0
Extra colon to make code block render correctly
…again

Apparently the previous fix c1ca42b didn't work.
Hopefully this time I'm testing this correctly.
…None (#7427)
Instead of slowing down startup, and making the code harder to follow,
compile it lazily (it is still cached internally).
1. Remove sys.maxunicode check & comment. Nowadays it is always a
   constant 0x10ffff.
2. Pre-generate the pattern. Possible due to 1.
3. Compile the regex lazily. No reason to pay startup cost for it.
4. Add docstring in particular to explain a subtle point.
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.
We now only use `py.path.local`.
mark: fix pylint not-callable error on pytest.mark.parametrize(...), again
junitxml: convert from py.xml to xml.etree.ElementTree
pathlib: stop using py.path.local.visit(), use os.scandir
mark: fix extraneous spaces in dummy type-checking marks
….set_level()

This probably regressed in fcbaab8.
logging: fix capture handler level not reset on teardown after caplog.set_level()
As discussed in #7556
…e-process
Co-authored-by: mattreex <mattreex.9@gail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Commits on Jul 30, 2020
Add missing changelog for issue 7569
Prepare release 6.0.1

(cherry picked from commit 022bff2)
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`.
Commits on Jul 31, 2020
In Python, if module A defines a name `name`, and module B does `import
name from A`, then another module C can `import name from B`.

Sometimes it is intentional -- module B is meant to "reexport" `name`.
But sometimes it is just confusion/inconsistency on where `name` should
be imported from.

mypy has a flag `--no-implicit-reexport` which puts some order into
this. A name can only be imported from a module if

1. The module defines the name
2. The module's `__all__` includes the name
3. The module imports the name as `from ... import .. as name`.

This flag is included in mypy's `--strict` flag.

I like this flag, but I realize it is a bit controversial, and in
particular item 3 above is a bit unfriendly to contributors who don't
know about it. So I didn't intend to add it to pytest.

But while investigating issue 7589 I came upon mypy issue 8754 which
causes `--no-implicit-reexport` to leak into installed libraries and
causes some unexpected typing differences *in pytest* if the user uses
this flag.

Since the diff mostly makes sense, let's just conform to it.
Stop using more-itertools
Commits on Aug 01, 2020
Merge pull request #7584 from pytest-dev/release-6.0.1
typing: set no_implicit_reexport
Format docstrings in a consistent style
Fixed location of double-backquote for verbatim text.
Minor formatting fix in xunit_setup.rst
This prevents referring to a generic type without filling in its generic
type parameters.

The FixtureDef typing might need some more refining in the future.
typing: set disallow_any_generics
Commits on Aug 02, 2020
Configure setuptools_scm using pyproject.toml
Commits on Aug 03, 2020
In preparation for enforcing some docstring lints.
There are some ones we *would* like to enforce, like
    D401 First line should be in imperative mood
but have too many false positives, so I left them out.
Commits on Aug 04, 2020
Enforce some pydocstyle lints with flake8-docstrings & docstring fixes in testing/
This is a follow up to 3f82006 which didn't
make it clear that log_print is also removed in the changelog and didn't remove
it from the reference docs.
This makes mypy raise an error whenever it detects code which is
statically unreachable, e.g.

    x: int
    if isinstance(x, str):
        ... # Statement is unreachable  [unreachable]

This is really neat and finds quite a few logic and typing bugs.

Sometimes the code is intentionally unreachable in terms of types, e.g.
raising TypeError when a function is given an argument with a wrong
type. In these cases a `type: ignore[unreachable]` is needed, but I
think it's a nice code hint.
Properly remove log_print
Add docs for releasing major/release candidates
typing: set warn_unreachable
typing: resultlog, pytester, longrepr
Co-authored-by: Ran Benita <ran@unusedvar.com>
Commits on Aug 05, 2020
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Commits on Aug 06, 2020
Fix test_plain_unittest_does_not_support_async on pypy3
An equivalent for these py.path.local functions is needed for some
upcoming py.path -> pathlib conversions.
Didn't call it absolute or absolute_path to avoid conflicts with
possible variable names.

Didn't call it abspath to avoid confusion with os.path.abspath.
Commits on Aug 07, 2020
Some py.path -> pathlib conversions
The correct name is visible in the Bitbucket link.
Fix typos in Ali Afshar's name
Commits on Aug 10, 2020
… class

See the code comment for the rationale.
It now has a str/bytes type parameter.
capture: add type annotations to CaptureFixture
Commits on Aug 12, 2020
Commits on Aug 13, 2020
Currently the badge encourages you to set it up now. :)
Replace inactive Azure Pipelines badge with GHA
Commits on Aug 14, 2020
and include a demo of toml 'literal strings'

Update doc/en/warnings.rst
Apply suggestion by Ran
Fix linting

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Add changelog for PR #7631
We used it as a shortcut for avoiding coverage, but pylint has a special
interpretation of it as an abstract method which we don't want.
Don't use NotImplementedError in `@overload`s
Commits on Aug 15, 2020
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 e2934c3 and
f10ab02 for reference.
Commits on Aug 16, 2020
…ing 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.
Commits on Aug 17, 2020
Commits on Aug 18, 2020
Only define gethookproxy, isinitpath on Session
Commits on Aug 19, 2020
Commits on Aug 22, 2020
The path part of a `<path>::part1::part2` style collection argument must
be a file, not a directory.

Previously this crashed with an uncool assert "invalid arg".
…s called more than once
Commits on Aug 23, 2020
main: improve message on `pytest path/to/a/directory::mytest`
logging: fix handler level restored incorrectly if caplog.set_level is called more than once
The 0-1 was a bit too optimistic: CI got "no tests ran in 3.98s".
testing: fix flaky test when executed slowly
Commits on Aug 24, 2020
capture: fix disabled()/global_and_fixture_disabled() enabling capturing when it was disabled
Make it a bit more accurate and use the same format that
pytest_runtest_protocol uses.
hookspec: improve collection phase documentation a bit
It doesn't add much, mostly just an eye sore, particularly with the
overloads.
Similar to the previous commit, this makes things more straightforward.
This reverts commit f10ab02.

The commit was good in that it removed a non-trivial amount of code
duplication. However it was done in the wrong layer (nodes.py) and split
up a major part of the collection (the filesystem traversal) to a
separate class making it harder to understand.

We should try to reduce the duplication, but in a more appropriate
manner.
The end result in the `else` branch is the same, but flows naturally.
Already covered in a condition above.
This is a more sensible interface for matchnodes.

This also fixes a sort-of bug where a recursive call to matchnodes
raises NoMatch which would terminate the entire tree, even if other
branches may find a match. Though I don't think it's actually possible.
It's a little more sane this way.
The weird name was due to f396733, now
that I understand it a bit better can give it a more descriptive name.
Things are easier to understand without the weird exception.
This removes an unhelpful level of indirection and enables some upcoming
upcoming simplifications.
Now all of the logic is in one place and may be simplified and
refactored in more sensible way.
They are only used for the duration of this function.
Commits on Aug 25, 2020
Start simplifying collection code in Session
* Update talks/trainings page

- Remove past webinar
- Add new open training
- Add some talks/webinars by Oliver Bestwalter and by me
- Remove some stale link targets

* Move sidebar to index
In ff8b788 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.
python: fix empty parametrize() leading to "NotSetType.token" id
Commits on Aug 26, 2020
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)
```
Commits on Aug 27, 2020
RFC: python: skip work pytest_pycollect_makeitem work on certain names
Inline `_makeitem()` so that `self.ihook` (which is moderately
expensive) can be called only once.

Note: the removed test "test_makeitem_non_underscore" comes from an old
behavior of skipping names that start with `_` which has since been
generalized, making the test no longer relevant.
Commits on Aug 28, 2020
I think the straight code is easier to understand.
As related in #7696
python: small optimization in PyCollector.collect()
Commits on Aug 29, 2020
fixture: remove `@scopeproperty`
Commits on Sep 03, 2020
Commits on Sep 04, 2020
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 handle of exceptions in ReprEntry with tb=line
config: start migrating Config.{rootdir,inifile} from py.path.local to pathlib
…e it

Before, `PluginManager` was a copy of the pluggy doc, and
`PytestPluginManager` was documented separately.

pytest users only really need to know about `PytestPluginManager`, so
instead of splitting have the `PytestPluginManager` documentation
include all of `PluginManager` members and remove `PluginManager` from
the reference (it is still shown as the base class).
When a name is exported from `pytest`, prefer to refer to it by that
rather than its `_pytest` import path. It is shorter and more
appropriate in user-facing documentation (although that's not really
visible).

Our plan is to expose more names for typing purposes, in which can this
could be more comprehensive.
The release-on-comment script is always executed on *master*, so we should
execute the `release.py` script using tox to ensure we create the
right environment.

Also fixed errors in the error handling code.
Use tox to execute release script
doc/reference: include PluginManager in PytestPluginManager and remove it
doc: prefer to reference by public name when possible
Commits on Sep 05, 2020
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
The sign-up is closed.
Commits on Sep 06, 2020
doc: Remove Workshoptage training
Commits on Sep 08, 2020
- be more vague about "packaging metadata" over explicitly mentioning `setup.py`
  (such that `pyproject.toml`-based distributions are allowed)
- drop extensions on `README.txt` / `LICENSE.txt` (it's more common to have `.md`
  / `.rst` / no extension)
- remove duplicate mention of license packaging metadata
Commits on Sep 09, 2020
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Update pytest-dev requirements
Commits on Sep 11, 2020
doc: fix a few broken cross references
Prepare release 6.0.2

(cherry picked from commit fe69bd5)
Merge pull request #7720 from pytest-dev/release-6.0.2
Commits on Sep 12, 2020
Fix INTERNALERROR when accessing locals / globals with faulty `exec`
…rated function

For decorated functions, the lineno of the FunctionDef AST node points
to the `def` line, not to the first decorator line. On the other hand,
in code objects, the `co_firstlineno` points to the first decorator
line.

Assertion rewriting inserts some imports to code it rewrites. The
imports are inserted at the lineno of the first statement in the AST. In
turn, the code object compiled from the rewritten AST uses the lineno of
the first statement (which is the first inserted import).

This means that given a module like this,

```py
@foo
@bar
def baz(): pass
```

the lineno of the code object without assertion rewriting
(`--assertion=plain`) is 1, but with assertion rewriting it is 3.

And *this* causes some issues for the exception repr when e.g. the
decorator line is invalid and raises during collection. The code becomes
confused and crashes with

INTERNALERROR>   File "_pytest/_code/code.py", line 638, in get_source
INTERNALERROR>     lines.append(space_prefix + source.lines[line_index].strip())
INTERNALERROR> IndexError: list index out of range

Fix it by special casing decorators. Maybe there are other cases like
this but off hand I can't think of another Python construct where the
lineno of the item would be after its first line, and this is the only
such issue we have had reported.
Commits on Sep 13, 2020
remove unused bitbucket link
permit tox config in non-tox.ini files for pytest-dev member projects
should be a noop (despite the major version bump) -- I rewrote the action to be more stable and need fewer security updates
Commits on Sep 14, 2020
Update to deadsnakes/action@v2.0.0
Add full command-line flags to the reference docs
Commits on Sep 15, 2020
Capitalize the first word in a sentence and add a period at the end.
Commits on Sep 16, 2020
Usually, we use semi-colon punctuation mark to connect closely related
ideas. Sentences which are after semicolon, begins with small letter,
and last sentence always ends with a period mark, see "Garner's Modern
American Usage" book for more information about usage of punctuation
mark. So removing punctuation mark altogether is a good idea, as
@gnikonorov suggested [1].

[1]: #7760 (review)
Co-authored-by: Florian Bruhin <me@the-compiler.org>
[Docs] remove semi-colon punctuation mark
Commits on Sep 17, 2020
Commits on Sep 19, 2020
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Warning about record_testsuite_property not working with xdist
Add guidelines section about backporting
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
RELEASING: ~~first merge PR, then tag~~ clarify where to push the tag
Co-authored-by: Ran Benita <ran@unusedvar.com>
Commits on Sep 21, 2020
Commits on Sep 22, 2020
This indicates at least for people using type checkers that these
classes are not designed for inheritance and we make no stability
guarantees regarding inheritance of them.

Currently this doesn't show up in the docs. Sphinx does actually support
`@final`, however it only works when imported directly from `typing`,
while we import from `_pytest.compat`.

In the future there might also be a `@sealed` decorator which would
cover some more cases.
Commits on Sep 23, 2020
Mark some public and to-be-public classes as `@final`
Fix #7783
Use new pip resolver in plugins tox env
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Commits on Sep 26, 2020
changelog: some consistency cleanups
Showing with 5,737 additions and 4,567 deletions.
  1. +1 −0 .coveragerc
  2. +8 −2 .github/{ISSUE_TEMPLATE.md → ISSUE_TEMPLATE/1_bug_report.md}
  3. +5 −0 .github/ISSUE_TEMPLATE/2_feature_request.md
  4. +5 −0 .github/ISSUE_TEMPLATE/config.yml
  5. +7 −1 .github/workflows/main.yml
  6. +7 −3 .pre-commit-config.yaml
  7. +12 −0 .readthedocs.yml
  8. +1 −0 AUTHORS
  9. +59 −7 CONTRIBUTING.rst
  10. +8 −8 README.rst
  11. +68 −19 RELEASING.rst
  12. +0 −2 changelog/7558.bugfix.rst
  13. +0 −1 changelog/7559.bugfix.rst
  14. +3 −2 doc/en/adopt.rst
  15. +3 −0 doc/en/announce/index.rst
  16. +1 −1 doc/en/announce/release-2.3.0.rst
  17. +1 −1 doc/en/announce/release-2.5.1.rst
  18. +1 −1 doc/en/announce/release-2.5.2.rst
  19. +1 −1 doc/en/announce/release-2.6.0.rst
  20. +1 −1 doc/en/announce/release-2.6.1.rst
  21. +1 −1 doc/en/announce/release-2.6.2.rst
  22. +1 −1 doc/en/announce/release-2.6.3.rst
  23. +1 −1 doc/en/announce/release-2.7.0.rst
  24. +1 −1 doc/en/announce/release-2.7.1.rst
  25. +1 −1 doc/en/announce/release-2.7.2.rst
  26. +1 −1 doc/en/announce/release-2.8.2.rst
  27. +1 −1 doc/en/announce/release-2.8.3.rst
  28. +1 −1 doc/en/announce/release-2.8.4.rst
  29. +1 −1 doc/en/announce/release-2.8.5.rst
  30. +1 −1 doc/en/announce/release-2.8.6.rst
  31. +1 −1 doc/en/announce/release-2.8.7.rst
  32. +1 −1 doc/en/announce/release-2.9.0.rst
  33. +1 −1 doc/en/announce/release-2.9.1.rst
  34. +1 −1 doc/en/announce/release-2.9.2.rst
  35. +1 −1 doc/en/announce/release-3.0.0.rst
  36. +1 −1 doc/en/announce/release-3.1.0.rst
  37. +1 −1 doc/en/announce/release-3.10.0.rst
  38. +1 −1 doc/en/announce/release-3.2.0.rst
  39. +1 −1 doc/en/announce/release-3.3.0.rst
  40. +1 −1 doc/en/announce/release-3.4.0.rst
  41. +1 −1 doc/en/announce/release-3.5.0.rst
  42. +1 −1 doc/en/announce/release-3.6.0.rst
  43. +1 −1 doc/en/announce/release-3.7.0.rst
  44. +1 −1 doc/en/announce/release-3.8.0.rst
  45. +1 −1 doc/en/announce/release-3.9.0.rst
  46. +1 −1 doc/en/announce/release-4.0.0.rst
  47. +1 −1 doc/en/announce/release-4.1.0.rst
  48. +1 −1 doc/en/announce/release-4.2.0.rst
  49. +1 −1 doc/en/announce/release-4.3.0.rst
  50. +1 −1 doc/en/announce/release-4.4.0.rst
  51. +1 −1 doc/en/announce/release-4.5.0.rst
  52. +1 −1 doc/en/announce/release-4.6.0.rst
  53. +1 −1 doc/en/announce/release-5.0.0.rst
  54. +1 −1 doc/en/announce/release-5.1.0.rst
  55. +1 −1 doc/en/announce/release-5.2.0.rst
  56. +1 −1 doc/en/announce/release-5.3.0.rst
  57. +1 −1 doc/en/announce/release-5.4.0.rst
  58. +21 −0 doc/en/announce/release-6.0.1.rst
  59. +19 −0 doc/en/announce/release-6.0.2.rst
  60. +44 −0 doc/en/announce/release-6.1.0.rst
  61. +31 −23 doc/en/builtin.rst
  62. +1 −1 doc/en/cache.rst
  63. +202 −3 doc/en/changelog.rst
  64. +0 −1 doc/en/contents.rst
  65. +8 −3 doc/en/customize.rst
  66. +78 −60 doc/en/deprecations.rst
  67. +6 −1 doc/en/example/markers.rst
  68. +1 −1 doc/en/example/nonpython.rst
  69. +5 −4 doc/en/example/nonpython/conftest.py
  70. +9 −0 doc/en/example/pythoncollection.rst
  71. +0 −158 doc/en/faq.rst
  72. +42 −8 doc/en/fixture.rst
  73. +2 −2 doc/en/funcarg_compare.rst
  74. +1 −1 doc/en/getting-started.rst
  75. +1 −1 doc/en/historical-notes.rst
  76. +12 −6 doc/en/index.rst
  77. +12 −2 doc/en/mark.rst
  78. +13 −13 doc/en/monkeypatch.rst
  79. +324 −45 doc/en/reference.rst
  80. +10 −9 doc/en/talks.rst
  81. +7 −2 doc/en/tmpdir.rst
  82. +7 −4 doc/en/usage.rst
  83. +17 −3 doc/en/warnings.rst
  84. +10 −5 doc/en/writing_plugins.rst
  85. +1 −1 doc/en/xunit_setup.rst
  86. +4 −4 extra/get_issues.py
  87. +6 −3 pyproject.toml
  88. +28 −39 scripts/release-on-comment.py
  89. +5 −8 scripts/release.minor.rst
  90. +2 −2 scripts/release.patch.rst
  91. +1 −3 scripts/release.py
  92. +3 −1 setup.cfg
  93. +1 −6 setup.py
  94. +28 −20 src/_pytest/_argcomplete.py
  95. +1 −1 src/_pytest/_code/__init__.py
  96. +104 −77 src/_pytest/_code/code.py
  97. +20 −25 src/_pytest/_code/source.py
  98. +10 −7 src/_pytest/_io/saferepr.py
  99. +9 −7 src/_pytest/_io/terminalwriter.py
  100. +9 −12 src/_pytest/assertion/__init__.py
  101. +28 −35 src/_pytest/assertion/rewrite.py
  102. +4 −10 src/_pytest/assertion/truncate.py
  103. +8 −8 src/_pytest/assertion/util.py
  104. +41 −39 src/_pytest/cacheprovider.py
  105. +154 −73 src/_pytest/capture.py
  106. +67 −52 src/_pytest/compat.py
  107. +338 −159 src/_pytest/config/__init__.py
  108. +44 −46 src/_pytest/config/argparsing.py
  109. +6 −4 src/_pytest/config/exceptions.py
  110. +61 −49 src/_pytest/config/findpaths.py
  111. +29 −19 src/_pytest/debugging.py
  112. +7 −42 src/_pytest/deprecated.py
  113. +38 −56 src/_pytest/doctest.py
  114. +3 −8 src/_pytest/faulthandler.py
  115. +275 −307 src/_pytest/fixtures.py
  116. +5 −10 src/_pytest/freeze_support.py
  117. +11 −7 src/_pytest/helpconfig.py
  118. +149 −144 src/_pytest/hookspec.py
  119. +128 −143 src/_pytest/junitxml.py
  120. +70 −73 src/_pytest/logging.py
  121. +358 −262 src/_pytest/main.py
  122. +21 −13 src/_pytest/mark/__init__.py
  123. +5 −5 src/_pytest/mark/expression.py
  124. +39 −34 src/_pytest/mark/structures.py
  125. +52 −48 src/_pytest/monkeypatch.py
  126. +95 −157 src/_pytest/nodes.py
  127. +6 −6 src/_pytest/nose.py
  128. +44 −44 src/_pytest/outcomes.py
  129. +10 −11 src/_pytest/pastebin.py
  130. +107 −54 src/_pytest/pathlib.py
  131. +212 −163 src/_pytest/pytester.py
  132. +222 −164 src/_pytest/python.py
  133. +51 −67 src/_pytest/python_api.py
  134. +12 −10 src/_pytest/recwarn.py
  135. +72 −69 src/_pytest/reports.py
  136. +0 −108 src/_pytest/resultlog.py
  137. +49 −33 src/_pytest/runner.py
  138. +3 −3 src/_pytest/setuponly.py
  139. +1 −1 src/_pytest/setupplan.py
  140. +3 −3 src/_pytest/skipping.py
  141. +3 −3 src/_pytest/store.py
  142. +67 −76 src/_pytest/terminal.py
  143. +1 −2 src/_pytest/timing.py
  144. +33 −38 src/_pytest/tmpdir.py
  145. +25 −23 src/_pytest/unittest.py
  146. +11 −1 src/_pytest/warning_types.py
  147. +17 −97 src/_pytest/warnings.py
  148. +1 −3 src/pytest/__init__.py
  149. +1 −3 src/pytest/__main__.py
  150. +3 −3 src/pytest/collect.py
  151. +15 −24 testing/acceptance_test.py
  152. +39 −18 testing/code/test_excinfo.py
  153. +1 −1 testing/code/test_source.py
  154. +27 −100 testing/deprecated_test.py
  155. +6 −0 testing/example_scripts/unittest/test_unittest_plain_async.py
  156. +1 −3 testing/freeze/create_executable.py
  157. +5 −4 testing/logging/test_fixture.py
  158. +7 −14 testing/logging/test_reporting.py
  159. +2 −0 testing/plugins_integration/.gitignore
  160. +13 −0 testing/plugins_integration/README.rst
  161. +9 −0 testing/plugins_integration/bdd_wallet.feature
  162. +39 −0 testing/plugins_integration/bdd_wallet.py
  163. +1 −0 testing/plugins_integration/django_settings.py
  164. +4 −0 testing/plugins_integration/pytest.ini
  165. +8 −0 testing/plugins_integration/pytest_anyio_integration.py
  166. +8 −0 testing/plugins_integration/pytest_asyncio_integration.py
  167. +2 −0 testing/plugins_integration/pytest_mock_integration.py
  168. +8 −0 testing/plugins_integration/pytest_trio_integration.py
  169. +18 −0 testing/plugins_integration/pytest_twisted_integration.py
  170. +10 −0 testing/plugins_integration/simple_integration.py
  171. +1 −3 testing/python/approx.py
  172. +36 −17 testing/python/collect.py
  173. +140 −106 testing/python/fixtures.py
  174. +3 −3 testing/python/integration.py
  175. +44 −40 testing/python/metafunc.py
  176. +20 −3 testing/python/raises.py
  177. +6 −8 testing/test_argcomplete.py
  178. +7 −13 testing/test_assertion.py
  179. +9 −12 testing/test_assertrewrite.py
  180. +1 −3 testing/test_cacheprovider.py
  181. +73 −8 testing/test_capture.py
  182. +19 −39 testing/test_collection.py
  183. +269 −129 testing/test_config.py
  184. +4 −20 testing/test_conftest.py
  185. +6 −14 testing/test_doctest.py
  186. +6 −8 testing/test_faulthandler.py
  187. +66 −51 testing/test_findpaths.py
  188. +33 −0 testing/test_helpconfig.py
  189. +13 −15 testing/test_junitxml.py
  190. +1 −3 testing/test_link_resolve.py
  191. +148 −0 testing/test_main.py
  192. +8 −12 testing/test_mark.py
  193. +1 −2 testing/test_meta.py
  194. +1 −1 testing/test_monkeypatch.py
  195. +5 −11 testing/test_pastebin.py
  196. +25 −6 testing/test_pathlib.py
  197. +2 −2 testing/test_pluginmanager.py
  198. +7 −5 testing/test_pytester.py
  199. +66 −42 testing/test_reports.py
  200. +0 −252 testing/test_resultlog.py
  201. +6 −9 testing/test_runner.py
  202. +2 −5 testing/test_runner_xunit.py
  203. +1 −1 testing/test_setuponly.py
  204. +3 −6 testing/test_setupplan.py
  205. +6 −15 testing/test_skipping.py
  206. +38 −42 testing/test_terminal.py
  207. +4 −2 testing/test_tmpdir.py
  208. +25 −3 testing/test_unittest.py
  209. +26 −44 testing/test_warnings.py
  210. +49 −1 tox.ini
@@ -27,3 +27,4 @@ exclude_lines =
^\s*assert False(,|$)

^\s*if TYPE_CHECKING:
^\s*@overload( |$)
@@ -1,10 +1,16 @@
---
name: 🐛 Bug Report
about: Report errors and problems

---

<!--
Thanks for submitting an issue!
Here's a quick checklist for what to provide:
Quick check-list while reporting bugs:
-->

- [ ] a detailed description of the bug or suggestion
- [ ] a detailed description of the bug or problem you are having
- [ ] output of `pip list` from the virtual environment you are using
- [ ] pytest and operating system versions
- [ ] minimal example if possible
@@ -0,0 +1,5 @@
---
name: 🚀 Feature Request
about: Ideas for new features and improvements

---
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ❓ Support Question
url: https://github.com/pytest-dev/pytest/discussions
about: Use GitHub's new Discussions feature for questions
@@ -41,6 +41,7 @@ jobs:

"docs",
"doctesting",
"plugins",
]

include:
@@ -111,6 +112,11 @@ jobs:
tox_env: "py38-xdist"
use_coverage: true

- name: "plugins"
python: "3.7"
os: ubuntu-latest
tox_env: "plugins"

- name: "docs"
python: "3.7"
os: ubuntu-latest
@@ -131,7 +137,7 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Set up Python ${{ matrix.python }} (deadsnakes)
uses: deadsnakes/action@v1.0.0
uses: deadsnakes/action@v2.0.0
if: matrix.python == '3.9-dev'
with:
python-version: ${{ matrix.python }}
@@ -25,7 +25,9 @@ repos:
hooks:
- id: flake8
language_version: python3
additional_dependencies: [flake8-typing-imports==1.9.0]
additional_dependencies:
- flake8-typing-imports==1.9.0
- flake8-docstrings==1.5.0
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.3.0
hooks:
@@ -70,9 +72,11 @@ repos:
_code\.|
builtin\.|
code\.|
io\.(BytesIO|saferepr|TerminalWriter)|
io\.|
path\.local\.sysfind|
process\.|
std\.
std\.|
error\.|
xml\.
)
types: [python]
@@ -0,0 +1,12 @@
version: 2

python:
version: 3.7
install:
- requirements: doc/en/requirements.txt
- method: pip
path: .

formats:
- epub
- pdf
@@ -151,6 +151,7 @@ Joshua Bronson
Jurko Gospodnetić
Justyna Janczyszyn
Kale Kundert
Kamran Ahmad
Karl O. Pinc
Katarzyna Jachim
Katarzyna Król
@@ -89,6 +89,38 @@ without using a local copy. This can be convenient for small fixes.
The built documentation should be available in ``doc/en/_build/html``,
where 'en' refers to the documentation language.

Pytest has an API reference which in large part is
`generated automatically <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`_
from the docstrings of the documented items. Pytest uses the
`Sphinx docstring format <https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html>`_.
For example:

.. code-block:: python
def my_function(arg: ArgType) -> Foo:
"""Do important stuff.
More detailed info here, in separate paragraphs from the subject line.
Use proper sentences -- start sentences with capital letters and end
with periods.
Can include annotated documentation:
:param short_arg: An argument which determines stuff.
:param long_arg:
A long explanation which spans multiple lines, overflows
like this.
:returns: The result.
:raises ValueError:
Detailed information when this can happen.
.. versionadded:: 6.0
Including types into the annotations above is not necessary when
type-hinting is being used (as in this example).
"""
.. _submitplugin:

Submitting Plugins to pytest-dev
@@ -99,8 +131,6 @@ in repositories living under the ``pytest-dev`` organisations:

- `pytest-dev on GitHub <https://github.com/pytest-dev>`_

- `pytest-dev on Bitbucket <https://bitbucket.org/pytest-dev>`_

All pytest-dev Contributors team members have write access to all contained
repositories. Pytest core and plugins are generally developed
using `pull requests`_ to respective repositories.
@@ -116,16 +146,17 @@ You can submit your plugin by subscribing to the `pytest-dev mail list
mail pointing to your existing pytest plugin repository which must have
the following:

- PyPI presence with a ``setup.py`` that contains a license, ``pytest-``
- PyPI presence with packaging metadata that contains a ``pytest-``
prefixed name, version number, authors, short and long description.

- a ``tox.ini`` for running tests using `tox <https://tox.readthedocs.io>`_.
- a `tox configuration <https://tox.readthedocs.io/en/latest/config.html#configuration-discovery>`_
for running tests using `tox <https://tox.readthedocs.io>`_.

- a ``README.txt`` describing how to use the plugin and on which
- a ``README`` describing how to use the plugin and on which
platforms it runs.

- a ``LICENSE.txt`` file or equivalent containing the licensing
information, with matching info in ``setup.py``.
- a ``LICENSE`` file containing the licensing information, with
matching info in its packaging metadata.

- an issue tracker for bug reports and enhancement requests.

@@ -375,6 +406,27 @@ actual latest release). The procedure for this is:
* Delete the PR body, it usually contains a duplicate commit message.


Who does the backporting
~~~~~~~~~~~~~~~~~~~~~~~~

As mentioned above, bugs should first be fixed on ``master`` (except in rare occasions
that a bug only happens in a previous release). So who should do the backport procedure described
above?

1. If the bug was fixed by a core developer, it is the main responsibility of that core developer
to do the backport.
2. However, often the merge is done by another maintainer, in which case it is nice of them to
do the backport procedure if they have the time.
3. For bugs submitted by non-maintainers, it is expected that a core developer will to do
the backport, normally the one that merged the PR on ``master``.
4. If a non-maintainers notices a bug which is fixed on ``master`` but has not been backported
(due to maintainers forgetting to apply the *needs backport* label, or just plain missing it),
they are also welcome to open a PR with the backport. The procedure is simple and really
helps with the maintenance of the project.

All the above are not rules, but merely some guidelines/suggestions on what we should expect
about backports.

Handling stale issues/PRs
-------------------------

@@ -22,8 +22,8 @@
.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master
:target: https://travis-ci.org/pytest-dev/pytest

.. image:: https://dev.azure.com/pytest-dev/pytest/_apis/build/status/pytest-CI?branchName=master
:target: https://dev.azure.com/pytest-dev/pytest
.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
@@ -77,21 +77,21 @@ Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` stat
Features
--------

- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/assert.html>`_ (no need to remember ``self.assert*`` names);
- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/assert.html>`_ (no need to remember ``self.assert*`` names)

- `Auto-discovery
<https://docs.pytest.org/en/stable/goodpractices.html#python-test-discovery>`_
of test modules and functions;
of test modules and functions

- `Modular fixtures <https://docs.pytest.org/en/stable/fixture.html>`_ for
managing small or parametrized long-lived test resources;
managing small or parametrized long-lived test resources

- Can run `unittest <https://docs.pytest.org/en/stable/unittest.html>`_ (or trial),
`nose <https://docs.pytest.org/en/stable/nose.html>`_ test suites out of the box;
`nose <https://docs.pytest.org/en/stable/nose.html>`_ test suites out of the box

- Python 3.5+ and PyPy3;
- Python 3.5+ and PyPy3

- Rich plugin architecture, with over 850+ `external plugins <http://plugincompat.herokuapp.com>`_ and thriving community;
- Rich plugin architecture, with over 850+ `external plugins <http://plugincompat.herokuapp.com>`_ and thriving community


Documentation
@@ -5,37 +5,85 @@ Our current policy for releasing is to aim for a bug-fix release every few weeks
is to get fixes and new features out instead of trying to cram a ton of features into a release and by consequence
taking a lot of time to make a new one.

The git commands assume the following remotes are setup:

* ``origin``: your own fork of the repository.
* ``upstream``: the ``pytest-dev/pytest`` official repository.

Preparing: Automatic Method
~~~~~~~~~~~~~~~~~~~~~~~~~~~

We have developed an automated workflow for releases, that uses GitHub workflows and is triggered
by opening an issue or issuing a comment one.
by opening an issue.

Bug-fix releases
^^^^^^^^^^^^^^^^

A bug-fix release is always done from a maintenance branch, so for example to release bug-fix
``5.1.2``, open a new issue and add this comment to the body::

@pytestbot please prepare release from 5.1.x

Where ``5.1.x`` is the maintenance branch for the ``5.1`` series.

The automated workflow will publish a PR for a branch ``release-5.1.2``
and notify it as a comment in the issue.

Minor releases
^^^^^^^^^^^^^^

1. Create a new maintenance branch from ``master``::

git fetch --all
git branch 5.2.x upstream/master
git push upstream 5.2.x

The comment must be in the form::
2. Open a new issue and add this comment to the body::

@pytestbot please prepare release from BRANCH
@pytestbot please prepare release from 5.2.x

Where ``BRANCH`` is ``master`` or one of the maintenance branches.
The automated workflow will publish a PR for a branch ``release-5.2.0`` and
notify it as a comment in the issue.

For major releases the comment must be in the form::
Major and release candidates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@pytestbot please prepare major release from master
1. Create a new maintenance branch from ``master``::

After that, the workflow should publish a PR and notify that it has done so as a comment
in the original issue.
git fetch --all
git branch 6.0.x upstream/master
git push upstream 6.0.x

2. For a **major release**, open a new issue and add this comment in the body::

@pytestbot please prepare major release from 6.0.x

For a **release candidate**, the comment must be (TODO: `#7551 <https://github.com/pytest-dev/pytest/issues/7551>`__)::

@pytestbot please prepare release candidate from 6.0.x

The automated workflow will publish a PR for a branch ``release-6.0.0`` and
notify it as a comment in the issue.

At this point on, this follows the same workflow as other maintenance branches: bug-fixes are merged
into ``master`` and ported back to the maintenance branch, even for release candidates.

**A note about release candidates**

During release candidates we can merge small improvements into
the maintenance branch before releasing the final major version, however we must take care
to avoid introducing big changes at this stage.

Preparing: Manual Method
~~~~~~~~~~~~~~~~~~~~~~~~

.. important::

pytest releases must be prepared on **Linux** because the docs and examples expect
to be executed on that platform.
**Important**: pytest releases must be prepared on **Linux** because the docs and examples expect
to be executed on that platform.

To release a version ``MAJOR.MINOR.PATCH``, follow these steps:

#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from the
latest ``master`` and push it to the ``pytest-dev/pytest`` repo.
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from
``upstream/master`` and push it to ``upstream``.

#. Create a branch ``release-MAJOR.MINOR.PATCH`` from the ``MAJOR.MINOR.x`` branch.

@@ -56,9 +104,10 @@ Releasing
Both automatic and manual processes described above follow the same steps from this point onward.

#. After all tests pass and the PR has been approved, tag the release commit
in the ``MAJOR.MINOR.x`` branch and push it. This will publish to PyPI::
in the ``release-MAJOR.MINOR.PATCH`` branch and push it. This will publish to PyPI::

git tag MAJOR.MINOR.PATCH
git fetch --all
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
git push git@github.com:pytest-dev/pytest.git MAJOR.MINOR.PATCH

Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
@@ -69,9 +118,9 @@ Both automatic and manual processes described above follow the same steps from t

git fetch --all --prune
git checkout origin/master -b cherry-pick-release
git cherry-pick --no-commit -m1 origin/MAJOR.MINOR.x
git checkout origin/master -- changelog
git commit # no arguments
git cherry-pick -x -m1 upstream/MAJOR.MINOR.x

#. Open a PR for ``cherry-pick-release`` and merge it once CI passes. No need to wait for approvals if there were no conflicts on the previous step.

#. Send an email announcement with the contents from::

This file was deleted.

This file was deleted.

@@ -45,7 +45,7 @@ Partner projects, sign up here! (by 22 March)
What does it mean to "adopt pytest"?
-----------------------------------------

There can be many different definitions of "success". Pytest can run many `nose and unittest`_ tests by default, so using pytest as your testrunner may be possible from day 1. Job done, right?
There can be many different definitions of "success". Pytest can run many nose_ and unittest_ tests by default, so using pytest as your testrunner may be possible from day 1. Job done, right?

Progressive success might look like:

@@ -63,7 +63,8 @@ Progressive success might look like:

It may be after the month is up, the partner project decides that pytest is not right for it. That's okay - hopefully the pytest team will also learn something about its weaknesses or deficiencies.

.. _`nose and unittest`: faq.html#how-does-pytest-relate-to-nose-and-unittest
.. _nose: nose.html
.. _unittest: unittest.html
.. _assert: assert.html
.. _pycmd: https://bitbucket.org/hpk42/pycmd/overview
.. _`setUp/tearDown methods`: xunit_setup.html

No commit comments for this range