Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Katerina Koukiou
Keri Volans
Kevin Cox
Kevin J. Foley
Kian-Meng Ang
Kodi B. Arfer
Kostis Anagnostopoulos
Kristoffer Nordström
Expand Down
2 changes: 1 addition & 1 deletion doc/en/announce/release-2.5.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ clear information about the circumstances and a simple example which
reproduces the problem.

The issue tracker is of course not empty now. We have many remaining
"enhacement" issues which we'll hopefully can tackle in 2014 with your
"enhancement" issues which we'll hopefully can tackle in 2014 with your
help.

For those who use older Python versions, please note that pytest is not
Expand Down
14 changes: 7 additions & 7 deletions doc/en/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ Bug Fixes
the ``tmp_path``/``tmpdir`` fixture). Now the directories are created with
private permissions.

pytest used to silenty use a pre-existing ``/tmp/pytest-of-<username>`` directory,
pytest used to silently use a pre-existing ``/tmp/pytest-of-<username>`` directory,
even if owned by another user. This means another user could pre-create such a
directory and gain control of another user's temporary directory. Now such a
condition results in an error.
Expand Down Expand Up @@ -1304,7 +1304,7 @@ Improvements
is not displayed by default for passing tests. This change makes the mistake
visible during testing.

You may supress this behavior temporarily or permanently by setting
You may suppress this behavior temporarily or permanently by setting
``logging.raiseExceptions = False``.


Expand Down Expand Up @@ -1759,7 +1759,7 @@ Bug Fixes
it was swallowed and ignored (regression in pytest 5.1.0).


- :issue:`6801`: Do not display empty lines inbetween traceback for unexpected exceptions with doctests.
- :issue:`6801`: Do not display empty lines in between traceback for unexpected exceptions with doctests.


- :issue:`6802`: The :fixture:`testdir fixture <testdir>` works within doctests now.
Expand Down Expand Up @@ -4628,7 +4628,7 @@ Bug Fixes
- Fixed a bug where stdout and stderr were logged twice by junitxml when a test
was marked xfail. (:issue:`3491`)

- Fix ``usefixtures`` mark applyed to unittest tests by correctly instantiating
- Fix ``usefixtures`` mark applied to unittest tests by correctly instantiating
``FixtureInfo``. (:issue:`3498`)

- Fix assertion rewriter compatibility with libraries that monkey patch
Expand Down Expand Up @@ -8009,7 +8009,7 @@ Bug fixes:
or through plugin hooks. Also introduce a "--strict" option which
will treat unregistered markers as errors
allowing to avoid typos and maintain a well described set of markers
for your test suite. See exaples at http://pytest.org/en/stable/how-to/mark.html
for your test suite. See examples at http://pytest.org/en/stable/how-to/mark.html
and its links.
- issue50: introduce "-m marker" option to select tests based on markers
(this is a stricter and more predictable version of '-k' in that "-m"
Expand Down Expand Up @@ -8321,7 +8321,7 @@ Bug fixes:
- fix issue57 -f|--looponfail to work with xpassing tests (thanks Ronny)
- fix issue92 collectonly reporter and --pastebin (thanks Benjamin Peterson)
- fix py.code.compile(source) to generate unique filenames
- fix assertion re-interp problems on PyPy, by defering code
- fix assertion re-interp problems on PyPy, by deferring code
compilation to the (overridable) Frame.eval class. (thanks Amaury Forgeot)
- fix py.path.local.pyimport() to work with directories
- streamline py.path.local.mkdtemp implementation and usage
Expand Down Expand Up @@ -8395,7 +8395,7 @@ Bug fixes:
- improve support for raises and other dynamically compiled code by
manipulating python's linecache.cache instead of the previous
rather hacky way of creating custom code objects. This makes
it seemlessly work on Jython and PyPy where it previously didn't.
it seamlessly work on Jython and PyPy where it previously didn't.

- fix issue96: make capturing more resilient against Control-C
interruptions (involved somewhat substantial refactoring
Expand Down
2 changes: 1 addition & 1 deletion doc/en/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ project:
which adds ``pytest`` (rather than ``py.test``) as the recommended
command-line entry point

Due to this history, it's diffcult to answer the question when pytest was started.
Due to this history, it's difficult to answer the question when pytest was started.
It depends what point should really be seen as the start of it all. One
possible interpretation is to pick Europython 2004, i.e. around June/July
2004.
2 changes: 1 addition & 1 deletion doc/en/how-to/skipping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Here is a simple test file with the several usages:

Running it with the report-on-xfail option gives this output:

.. FIXME: Use $ instead of ! again to reenable regendoc once it's fixed:
.. FIXME: Use $ instead of ! again to re-enable regendoc once it's fixed:
https://github.com/pytest-dev/pytest/issues/8807

.. code-block:: pytest
Expand Down
2 changes: 1 addition & 1 deletion doc/en/reference/fixtures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ the one defined in ``tests/test_top.py`` would be unavailable to it because it
would have to step down a level (step inside a circle) to find it.

The first fixture the test finds is the one that will be used, so
:ref:`fixtures can be overriden <override fixtures>` if you need to change or
:ref:`fixtures can be overridden <override fixtures>` if you need to change or
extend what one does for a particular scope.

You can also use the ``conftest.py`` file to implement
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/_code/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def _truncate_recursive_traceback(
max_frames=max_frames,
total=len(traceback),
)
# Type ignored because adding two instaces of a List subtype
# Type ignored because adding two instances of a List subtype
# currently incorrectly has type List instead of the subtype.
traceback = traceback[:max_frames] + traceback[-max_frames:] # type: ignore
else:
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/assertion/rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def _call_assertion_pass(lineno: int, orig: str, expl: str) -> None:

def _check_if_assertion_pass_impl() -> bool:
"""Check if any plugins implement the pytest_assertion_pass hook
in order not to generate explanation unecessarily (might be expensive)."""
in order not to generate explanation unnecessarily (might be expensive)."""
return True if util._assertion_pass else False


Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/assertion/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def has_default_eq(

First, we check if the object's __eq__ attribute has __code__,
if so, we check the equally of the method code filename (__code__.co_filename)
to the default onces generated by the dataclass and attr module
to the default one generated by the dataclass and attr module
for dataclasses the default co_filename is <string>, for attrs class, the __eq__ should contain "attrs eq generated"
"""
# inspired from https://github.com/willmcgugan/rich/blob/07d51ffc1aee6f16bd2e5a25b4e82850fb9ed778/rich/pretty.py#L68
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ def inipath(self) -> Optional[Path]:

def add_cleanup(self, func: Callable[[], None]) -> None:
"""Add a function to be called when the config object gets out of
use (usually coninciding with pytest_unconfigure)."""
use (usually coinciding with pytest_unconfigure)."""
self._cleanup.append(func)

def _do_configure(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/config/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PathAwareHookProxy:
this helper wraps around hook callers
until pluggy supports fixingcalls, this one will do

it currently doesnt return full hook caller proxies for fixed hooks,
it currently doesn't return full hook caller proxies for fixed hooks,
this may have to be changed later depending on bugs
"""

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/junitxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def append_skipped(self, report: TestReport) -> None:
def finalize(self) -> None:
data = self.to_xml()
self.__dict__.clear()
# Type ignored becuase mypy doesn't like overriding a method.
# Type ignored because mypy doesn't like overriding a method.
# Also the return value doesn't match...
self.to_xml = lambda: data # type: ignore[assignment]

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/mark/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def __len__(self) -> int:
class Expression:
"""A compiled match expression as used by -k and -m.
The expression can be evaulated against different matchers.
The expression can be evaluated against different matchers.
"""

__slots__ = ("code",)
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ def collect_by_name(
) -> Optional[Union[Item, Collector]]:
"""Return the collection node for name from the module collection.

Searchs a module collection node for a collection node matching the
Searches a module collection node for a collection node matching the
given name.

:param modcol: A module collection node; see :py:meth:`getmodulecol`.
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@ def __init__(
# this will be redeemed later
for mark in callspec.marks:
# feel free to cry, this was broken for years before
# and keywords cant fix it per design
# and keywords can't fix it per design
self.keywords[mark.name] = mark
self.own_markers.extend(normalize_mark_list(callspec.marks))
if keywords:
Expand Down
2 changes: 1 addition & 1 deletion testing/acceptance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ def test_simple():
reason="Windows raises `OSError: [Errno 22] Invalid argument` instead",
)
def test_no_brokenpipeerror_message(pytester: Pytester) -> None:
"""Ensure that the broken pipe error message is supressed.
"""Ensure that the broken pipe error message is suppressed.

In some Python versions, it reaches sys.unraisablehook, in others
a BrokenPipeError exception is propagated, but either way it prints
Expand Down
2 changes: 1 addition & 1 deletion testing/code/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def deco_fixture():

src = inspect.getsource(deco_fixture)
assert src == " @pytest.fixture\n def deco_fixture():\n assert False\n"
# currenly Source does not unwrap decorators, testing the
# currently Source does not unwrap decorators, testing the
# existing behavior here for explicitness, but perhaps we should revisit/change this
# in the future
assert str(Source(deco_fixture)).startswith("@functools.wraps(function)")
Expand Down
4 changes: 2 additions & 2 deletions testing/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ def raise_baseexception(self):

@property
def raise_exception(self):
raise Exception("exception should be catched")
raise Exception("exception should be caught")

@property
def raise_fail_outcome(self):
pytest.fail("fail should be catched")
pytest.fail("fail should be caught")


def test_helper_failures() -> None:
Expand Down
4 changes: 2 additions & 2 deletions testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def pytest_configure(config):
pytest.param(
"""
[some_other_header]
required_plugins = wont be triggered
required_plugins = won't be triggered
[pytest]
""",
"1.5",
Expand Down Expand Up @@ -807,7 +807,7 @@ def test_confcutdir_check_isdir(self, pytester: Pytester) -> None:
with pytest.raises(pytest.UsageError, match=exp_match):
pytester.parseconfig("--confcutdir", pytester.path.joinpath("file"))
with pytest.raises(pytest.UsageError, match=exp_match):
pytester.parseconfig("--confcutdir", pytester.path.joinpath("inexistant"))
pytester.parseconfig("--confcutdir", pytester.path.joinpath("nonexistent"))

p = pytester.mkdir("dir")
config = pytester.parseconfig("--confcutdir", p)
Expand Down
4 changes: 2 additions & 2 deletions testing/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_collect_module_two_doctest_no_modulelevel(
'# Empty'
def my_func():
">>> magic = 42 "
def unuseful():
def useless():
'''
# This is a function
# >>> # it doesn't have any doctest
Expand Down Expand Up @@ -564,7 +564,7 @@ def my_func():
>>> magic - 42
0
'''
def unuseful():
def useless():
pass
def another():
'''
Expand Down
2 changes: 1 addition & 1 deletion testing/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def teardown_class(cls):
def test_func():
import sys
# on python2 exc_info is keept till a function exits
# on python2 exc_info is kept till a function exits
# so we would end up calling test functions while
# sys.exc_info would return the indexerror
# from guessing the lastitem
Expand Down
2 changes: 1 addition & 1 deletion testing/test_stash.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_stash() -> None:
with pytest.raises(AttributeError):
stash.foo = "nope" # type: ignore[attr-defined]

# No interaction with anoter stash.
# No interaction with another stash.
stash2 = Stash()
key3 = StashKey[int]()
assert key2 not in stash2
Expand Down
4 changes: 2 additions & 2 deletions testing/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def pytest_warning_recorded(self, warning_message, when, nodeid, location):
assert collected_result[2] == expected_result[2], str(collected)

# NOTE: collected_result[3] is location, which differs based on the platform you are on
# thus, the best we can do here is assert the types of the paremeters match what we expect
# thus, the best we can do here is assert the types of the parameters match what we expect
# and not try and preload it in the expected array
if collected_result[3] is not None:
assert type(collected_result[3][0]) is str, str(collected)
Expand Down Expand Up @@ -708,7 +708,7 @@ def test_issue4445_preparse(self, pytester: Pytester, capwarn) -> None:
pytester.parseconfig("--help")

# with stacklevel=2 the warning should originate from config._preparse and is
# thrown by an errorneous conftest.py
# thrown by an erroneous conftest.py
assert len(capwarn.captured) == 1
warning, location = capwarn.captured.pop()
file, _, func = location
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ commands =
{envpython} tox_run.py

[testenv:release]
decription = do a release, required posarg of the version number
description = do a release, required posarg of the version number
basepython = python3
usedevelop = True
passenv = *
Expand All @@ -144,7 +144,7 @@ deps =
commands = python scripts/release.py {posargs}

[testenv:prepare-release-pr]
decription = prepare a release PR from a manual trigger in GitHub actions
description = prepare a release PR from a manual trigger in GitHub actions
usedevelop = {[testenv:release]usedevelop}
passenv = {[testenv:release]passenv}
deps = {[testenv:release]deps}
Expand Down