Fix typos (#9424)
This commit is contained in:
parent
7a42db2bf0
commit
55debfad1f
1
AUTHORS
1
AUTHORS
|
@ -185,6 +185,7 @@ Katerina Koukiou
|
||||||
Keri Volans
|
Keri Volans
|
||||||
Kevin Cox
|
Kevin Cox
|
||||||
Kevin J. Foley
|
Kevin J. Foley
|
||||||
|
Kian-Meng Ang
|
||||||
Kodi B. Arfer
|
Kodi B. Arfer
|
||||||
Kostis Anagnostopoulos
|
Kostis Anagnostopoulos
|
||||||
Kristoffer Nordström
|
Kristoffer Nordström
|
||||||
|
|
|
@ -11,7 +11,7 @@ clear information about the circumstances and a simple example which
|
||||||
reproduces the problem.
|
reproduces the problem.
|
||||||
|
|
||||||
The issue tracker is of course not empty now. We have many remaining
|
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.
|
help.
|
||||||
|
|
||||||
For those who use older Python versions, please note that pytest is not
|
For those who use older Python versions, please note that pytest is not
|
||||||
|
|
|
@ -538,7 +538,7 @@ Bug Fixes
|
||||||
the ``tmp_path``/``tmpdir`` fixture). Now the directories are created with
|
the ``tmp_path``/``tmpdir`` fixture). Now the directories are created with
|
||||||
private permissions.
|
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
|
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
|
directory and gain control of another user's temporary directory. Now such a
|
||||||
condition results in an error.
|
condition results in an error.
|
||||||
|
@ -1304,7 +1304,7 @@ Improvements
|
||||||
is not displayed by default for passing tests. This change makes the mistake
|
is not displayed by default for passing tests. This change makes the mistake
|
||||||
visible during testing.
|
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``.
|
``logging.raiseExceptions = False``.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1759,7 +1759,7 @@ Bug Fixes
|
||||||
it was swallowed and ignored (regression in pytest 5.1.0).
|
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.
|
- :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
|
- Fixed a bug where stdout and stderr were logged twice by junitxml when a test
|
||||||
was marked xfail. (:issue:`3491`)
|
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`)
|
``FixtureInfo``. (:issue:`3498`)
|
||||||
|
|
||||||
- Fix assertion rewriter compatibility with libraries that monkey patch
|
- 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
|
or through plugin hooks. Also introduce a "--strict" option which
|
||||||
will treat unregistered markers as errors
|
will treat unregistered markers as errors
|
||||||
allowing to avoid typos and maintain a well described set of markers
|
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.
|
and its links.
|
||||||
- issue50: introduce "-m marker" option to select tests based on markers
|
- issue50: introduce "-m marker" option to select tests based on markers
|
||||||
(this is a stricter and more predictable version of '-k' in that "-m"
|
(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 issue57 -f|--looponfail to work with xpassing tests (thanks Ronny)
|
||||||
- fix issue92 collectonly reporter and --pastebin (thanks Benjamin Peterson)
|
- fix issue92 collectonly reporter and --pastebin (thanks Benjamin Peterson)
|
||||||
- fix py.code.compile(source) to generate unique filenames
|
- 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)
|
compilation to the (overridable) Frame.eval class. (thanks Amaury Forgeot)
|
||||||
- fix py.path.local.pyimport() to work with directories
|
- fix py.path.local.pyimport() to work with directories
|
||||||
- streamline py.path.local.mkdtemp implementation and usage
|
- streamline py.path.local.mkdtemp implementation and usage
|
||||||
|
@ -8395,7 +8395,7 @@ Bug fixes:
|
||||||
- improve support for raises and other dynamically compiled code by
|
- improve support for raises and other dynamically compiled code by
|
||||||
manipulating python's linecache.cache instead of the previous
|
manipulating python's linecache.cache instead of the previous
|
||||||
rather hacky way of creating custom code objects. This makes
|
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
|
- fix issue96: make capturing more resilient against Control-C
|
||||||
interruptions (involved somewhat substantial refactoring
|
interruptions (involved somewhat substantial refactoring
|
||||||
|
|
|
@ -139,7 +139,7 @@ project:
|
||||||
which adds ``pytest`` (rather than ``py.test``) as the recommended
|
which adds ``pytest`` (rather than ``py.test``) as the recommended
|
||||||
command-line entry point
|
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
|
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
|
possible interpretation is to pick Europython 2004, i.e. around June/July
|
||||||
2004.
|
2004.
|
||||||
|
|
|
@ -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:
|
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
|
https://github.com/pytest-dev/pytest/issues/8807
|
||||||
|
|
||||||
.. code-block:: pytest
|
.. code-block:: pytest
|
||||||
|
|
|
@ -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.
|
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
|
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.
|
extend what one does for a particular scope.
|
||||||
|
|
||||||
You can also use the ``conftest.py`` file to implement
|
You can also use the ``conftest.py`` file to implement
|
||||||
|
|
|
@ -895,7 +895,7 @@ class FormattedExcinfo:
|
||||||
max_frames=max_frames,
|
max_frames=max_frames,
|
||||||
total=len(traceback),
|
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.
|
# currently incorrectly has type List instead of the subtype.
|
||||||
traceback = traceback[:max_frames] + traceback[-max_frames:] # type: ignore
|
traceback = traceback[:max_frames] + traceback[-max_frames:] # type: ignore
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -513,7 +513,7 @@ def _call_assertion_pass(lineno: int, orig: str, expl: str) -> None:
|
||||||
|
|
||||||
def _check_if_assertion_pass_impl() -> bool:
|
def _check_if_assertion_pass_impl() -> bool:
|
||||||
"""Check if any plugins implement the pytest_assertion_pass hook
|
"""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
|
return True if util._assertion_pass else False
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ def has_default_eq(
|
||||||
|
|
||||||
First, we check if the object's __eq__ attribute has __code__,
|
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)
|
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"
|
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
|
# inspired from https://github.com/willmcgugan/rich/blob/07d51ffc1aee6f16bd2e5a25b4e82850fb9ed778/rich/pretty.py#L68
|
||||||
|
|
|
@ -970,7 +970,7 @@ class Config:
|
||||||
|
|
||||||
def add_cleanup(self, func: Callable[[], None]) -> None:
|
def add_cleanup(self, func: Callable[[], None]) -> None:
|
||||||
"""Add a function to be called when the config object gets out of
|
"""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)
|
self._cleanup.append(func)
|
||||||
|
|
||||||
def _do_configure(self) -> None:
|
def _do_configure(self) -> None:
|
||||||
|
|
|
@ -23,7 +23,7 @@ class PathAwareHookProxy:
|
||||||
this helper wraps around hook callers
|
this helper wraps around hook callers
|
||||||
until pluggy supports fixingcalls, this one will do
|
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
|
this may have to be changed later depending on bugs
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,7 @@ class _NodeReporter:
|
||||||
def finalize(self) -> None:
|
def finalize(self) -> None:
|
||||||
data = self.to_xml()
|
data = self.to_xml()
|
||||||
self.__dict__.clear()
|
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...
|
# Also the return value doesn't match...
|
||||||
self.to_xml = lambda: data # type: ignore[assignment]
|
self.to_xml = lambda: data # type: ignore[assignment]
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ class MatcherAdapter(Mapping[str, bool]):
|
||||||
class Expression:
|
class Expression:
|
||||||
"""A compiled match expression as used by -k and -m.
|
"""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",)
|
__slots__ = ("code",)
|
||||||
|
|
|
@ -1288,7 +1288,7 @@ class Pytester:
|
||||||
) -> Optional[Union[Item, Collector]]:
|
) -> Optional[Union[Item, Collector]]:
|
||||||
"""Return the collection node for name from the module collection.
|
"""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.
|
given name.
|
||||||
|
|
||||||
:param modcol: A module collection node; see :py:meth:`getmodulecol`.
|
:param modcol: A module collection node; see :py:meth:`getmodulecol`.
|
||||||
|
|
|
@ -1655,7 +1655,7 @@ class Function(PyobjMixin, nodes.Item):
|
||||||
# this will be redeemed later
|
# this will be redeemed later
|
||||||
for mark in callspec.marks:
|
for mark in callspec.marks:
|
||||||
# feel free to cry, this was broken for years before
|
# 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.keywords[mark.name] = mark
|
||||||
self.own_markers.extend(normalize_mark_list(callspec.marks))
|
self.own_markers.extend(normalize_mark_list(callspec.marks))
|
||||||
if keywords:
|
if keywords:
|
||||||
|
|
|
@ -1281,7 +1281,7 @@ def test_tee_stdio_captures_and_live_prints(pytester: Pytester) -> None:
|
||||||
reason="Windows raises `OSError: [Errno 22] Invalid argument` instead",
|
reason="Windows raises `OSError: [Errno 22] Invalid argument` instead",
|
||||||
)
|
)
|
||||||
def test_no_brokenpipeerror_message(pytester: Pytester) -> None:
|
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
|
In some Python versions, it reaches sys.unraisablehook, in others
|
||||||
a BrokenPipeError exception is propagated, but either way it prints
|
a BrokenPipeError exception is propagated, but either way it prints
|
||||||
|
|
|
@ -483,7 +483,7 @@ def test_source_with_decorator() -> None:
|
||||||
|
|
||||||
src = inspect.getsource(deco_fixture)
|
src = inspect.getsource(deco_fixture)
|
||||||
assert src == " @pytest.fixture\n def deco_fixture():\n assert False\n"
|
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
|
# existing behavior here for explicitness, but perhaps we should revisit/change this
|
||||||
# in the future
|
# in the future
|
||||||
assert str(Source(deco_fixture)).startswith("@functools.wraps(function)")
|
assert str(Source(deco_fixture)).startswith("@functools.wraps(function)")
|
||||||
|
|
|
@ -156,11 +156,11 @@ class ErrorsHelper:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def raise_exception(self):
|
def raise_exception(self):
|
||||||
raise Exception("exception should be catched")
|
raise Exception("exception should be caught")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def raise_fail_outcome(self):
|
def raise_fail_outcome(self):
|
||||||
pytest.fail("fail should be catched")
|
pytest.fail("fail should be caught")
|
||||||
|
|
||||||
|
|
||||||
def test_helper_failures() -> None:
|
def test_helper_failures() -> None:
|
||||||
|
|
|
@ -386,7 +386,7 @@ class TestParseIni:
|
||||||
pytest.param(
|
pytest.param(
|
||||||
"""
|
"""
|
||||||
[some_other_header]
|
[some_other_header]
|
||||||
required_plugins = wont be triggered
|
required_plugins = won't be triggered
|
||||||
[pytest]
|
[pytest]
|
||||||
""",
|
""",
|
||||||
"1.5",
|
"1.5",
|
||||||
|
@ -807,7 +807,7 @@ class TestConfigAPI:
|
||||||
with pytest.raises(pytest.UsageError, match=exp_match):
|
with pytest.raises(pytest.UsageError, match=exp_match):
|
||||||
pytester.parseconfig("--confcutdir", pytester.path.joinpath("file"))
|
pytester.parseconfig("--confcutdir", pytester.path.joinpath("file"))
|
||||||
with pytest.raises(pytest.UsageError, match=exp_match):
|
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")
|
p = pytester.mkdir("dir")
|
||||||
config = pytester.parseconfig("--confcutdir", p)
|
config = pytester.parseconfig("--confcutdir", p)
|
||||||
|
|
|
@ -80,7 +80,7 @@ class TestDoctests:
|
||||||
'# Empty'
|
'# Empty'
|
||||||
def my_func():
|
def my_func():
|
||||||
">>> magic = 42 "
|
">>> magic = 42 "
|
||||||
def unuseful():
|
def useless():
|
||||||
'''
|
'''
|
||||||
# This is a function
|
# This is a function
|
||||||
# >>> # it doesn't have any doctest
|
# >>> # it doesn't have any doctest
|
||||||
|
@ -564,7 +564,7 @@ class TestDoctests:
|
||||||
>>> magic - 42
|
>>> magic - 42
|
||||||
0
|
0
|
||||||
'''
|
'''
|
||||||
def unuseful():
|
def useless():
|
||||||
pass
|
pass
|
||||||
def another():
|
def another():
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -287,7 +287,7 @@ class BaseFunctionalTests:
|
||||||
|
|
||||||
def test_func():
|
def test_func():
|
||||||
import sys
|
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
|
# so we would end up calling test functions while
|
||||||
# sys.exc_info would return the indexerror
|
# sys.exc_info would return the indexerror
|
||||||
# from guessing the lastitem
|
# from guessing the lastitem
|
||||||
|
|
|
@ -56,7 +56,7 @@ def test_stash() -> None:
|
||||||
with pytest.raises(AttributeError):
|
with pytest.raises(AttributeError):
|
||||||
stash.foo = "nope" # type: ignore[attr-defined]
|
stash.foo = "nope" # type: ignore[attr-defined]
|
||||||
|
|
||||||
# No interaction with anoter stash.
|
# No interaction with another stash.
|
||||||
stash2 = Stash()
|
stash2 = Stash()
|
||||||
key3 = StashKey[int]()
|
key3 = StashKey[int]()
|
||||||
assert key2 not in stash2
|
assert key2 not in stash2
|
||||||
|
|
|
@ -289,7 +289,7 @@ def test_warning_recorded_hook(pytester: Pytester) -> None:
|
||||||
assert collected_result[2] == expected_result[2], str(collected)
|
assert collected_result[2] == expected_result[2], str(collected)
|
||||||
|
|
||||||
# NOTE: collected_result[3] is location, which differs based on the platform you are on
|
# 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
|
# and not try and preload it in the expected array
|
||||||
if collected_result[3] is not None:
|
if collected_result[3] is not None:
|
||||||
assert type(collected_result[3][0]) is str, str(collected)
|
assert type(collected_result[3][0]) is str, str(collected)
|
||||||
|
@ -708,7 +708,7 @@ class TestStackLevel:
|
||||||
pytester.parseconfig("--help")
|
pytester.parseconfig("--help")
|
||||||
|
|
||||||
# with stacklevel=2 the warning should originate from config._preparse and is
|
# 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
|
assert len(capwarn.captured) == 1
|
||||||
warning, location = capwarn.captured.pop()
|
warning, location = capwarn.captured.pop()
|
||||||
file, _, func = location
|
file, _, func = location
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -130,7 +130,7 @@ commands =
|
||||||
{envpython} tox_run.py
|
{envpython} tox_run.py
|
||||||
|
|
||||||
[testenv:release]
|
[testenv:release]
|
||||||
decription = do a release, required posarg of the version number
|
description = do a release, required posarg of the version number
|
||||||
basepython = python3
|
basepython = python3
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
passenv = *
|
passenv = *
|
||||||
|
@ -144,7 +144,7 @@ deps =
|
||||||
commands = python scripts/release.py {posargs}
|
commands = python scripts/release.py {posargs}
|
||||||
|
|
||||||
[testenv:prepare-release-pr]
|
[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}
|
usedevelop = {[testenv:release]usedevelop}
|
||||||
passenv = {[testenv:release]passenv}
|
passenv = {[testenv:release]passenv}
|
||||||
deps = {[testenv:release]deps}
|
deps = {[testenv:release]deps}
|
||||||
|
|
Loading…
Reference in New Issue