This commit is contained in:
Kian Meng, Ang 2021-12-27 20:23:15 +08:00 committed by GitHub
parent 7a42db2bf0
commit 55debfad1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 35 additions and 34 deletions

View File

@ -185,6 +185,7 @@ Katerina Koukiou
Keri Volans
Kevin Cox
Kevin J. Foley
Kian-Meng Ang
Kodi B. Arfer
Kostis Anagnostopoulos
Kristoffer Nordström

View File

@ -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

View File

@ -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.
@ -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``.
@ -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.
@ -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
@ -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"
@ -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
@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -895,7 +895,7 @@ class FormattedExcinfo:
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:

View File

@ -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

View File

@ -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

View File

@ -970,7 +970,7 @@ class Config:
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:

View File

@ -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
"""

View File

@ -256,7 +256,7 @@ class _NodeReporter:
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]

View File

@ -190,7 +190,7 @@ class MatcherAdapter(Mapping[str, bool]):
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",)

View File

@ -1288,7 +1288,7 @@ class Pytester:
) -> 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`.

View File

@ -1655,7 +1655,7 @@ class Function(PyobjMixin, nodes.Item):
# 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:

View File

@ -1281,7 +1281,7 @@ def test_tee_stdio_captures_and_live_prints(pytester: Pytester) -> None:
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

View File

@ -483,7 +483,7 @@ def test_source_with_decorator() -> None:
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)")

View File

@ -156,11 +156,11 @@ class ErrorsHelper:
@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:

View File

@ -386,7 +386,7 @@ class TestParseIni:
pytest.param(
"""
[some_other_header]
required_plugins = wont be triggered
required_plugins = won't be triggered
[pytest]
""",
"1.5",
@ -807,7 +807,7 @@ class TestConfigAPI:
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)

View File

@ -80,7 +80,7 @@ class TestDoctests:
'# Empty'
def my_func():
">>> magic = 42 "
def unuseful():
def useless():
'''
# This is a function
# >>> # it doesn't have any doctest
@ -564,7 +564,7 @@ class TestDoctests:
>>> magic - 42
0
'''
def unuseful():
def useless():
pass
def another():
'''

View File

@ -287,7 +287,7 @@ class BaseFunctionalTests:
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

View File

@ -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

View File

@ -289,7 +289,7 @@ def test_warning_recorded_hook(pytester: Pytester) -> None:
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)
@ -708,7 +708,7 @@ class TestStackLevel:
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

View File

@ -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 = *
@ -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}