Skip to content

Commit

Permalink
Spelling and minor changes (#12122)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed May 15, 2024
1 parent fa1d5be commit 8d00811
Show file tree
Hide file tree
Showing 46 changed files with 100 additions and 97 deletions.
4 changes: 2 additions & 2 deletions doc/en/announce/release-2.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ New Features
- new "-q" option which decreases verbosity and prints a more
nose/unittest-style "dot" output.

- many many more detailed improvements details
- many, many, more detailed improvements details

Fixes
-----------------------
Expand Down Expand Up @@ -109,7 +109,7 @@ Important Notes
in conftest.py files. They will cause nothing special.
- removed support for calling the pre-1.0 collection API of "run()" and "join"
- removed reading option values from conftest.py files or env variables.
This can now be done much much better and easier through the ini-file
This can now be done much, much, better and easier through the ini-file
mechanism and the "addopts" entry in particular.
- removed the "disabled" attribute in test classes. Use the skipping
and pytestmark mechanism to skip or xfail a test class.
Expand Down
2 changes: 1 addition & 1 deletion doc/en/announce/release-2.2.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pytest-2.2.2: bug fixes
pytest-2.2.2 (updated to 2.2.3 to fix packaging issues) is a minor
backward-compatible release of the versatile py.test testing tool. It
contains bug fixes and a few refinements particularly to reporting with
"--collectonly", see below for betails.
"--collectonly", see below for details.

For general information see here:

Expand Down
2 changes: 1 addition & 1 deletion doc/en/announce/release-2.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Bug fixes:
partially failed (finalizers would not always be called before)

- fix issue320 - fix class scope for fixtures when mixed with
module-level functions. Thanks Anatloy Bubenkoff.
module-level functions. Thanks Anatoly Bubenkoff.

- you can specify "-q" or "-qq" to get different levels of "quieter"
reporting (thanks Katarzyna Jachim)
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 @@ -83,7 +83,7 @@ holger krekel
Thanks Ralph Schmitt for the precise failure example.

- fix issue244 by implementing special index for parameters to only use
indices for paramentrized test ids
indices for parametrized test ids

- fix issue287 by running all finalizers but saving the exception
from the first failing finalizer and re-raising it so teardown will
Expand Down
2 changes: 1 addition & 1 deletion doc/en/announce/release-2.6.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ holger krekel
- cleanup setup.py a bit and specify supported versions. Thanks Jurko
Gospodnetic for the PR.

- change XPASS colour to yellow rather then red when tests are run
- change XPASS colour to yellow rather than red when tests are run
with -v.

- fix issue473: work around mock putting an unbound method into a class
Expand Down
2 changes: 1 addition & 1 deletion doc/en/announce/release-2.7.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ holger krekel
github. See https://pytest.org/en/stable/contributing.html .
Thanks to Anatoly for pushing and initial work on this.

- fix issue650: new option ``--docttest-ignore-import-errors`` which
- fix issue650: new option ``--doctest-ignore-import-errors`` which
will turn import errors in doctests into skips. Thanks Charles Cloud
for the complete PR.

Expand Down
2 changes: 1 addition & 1 deletion doc/en/announce/sprint2016.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ place on 20th, 21st, 22nd, 24th and 25th. On the 23rd we took a break
day for some hot hiking in the Black Forest.

Sprint activity was organised heavily around pairing, with plenty of group
discusssions to take advantage of the high bandwidth, and lightning talks
discussions to take advantage of the high bandwidth, and lightning talks
as well.


Expand Down
38 changes: 19 additions & 19 deletions doc/en/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Improvements
- `#11311 <https://github.com/pytest-dev/pytest/issues/11311>`_: When using ``--override-ini`` for paths in invocations without a configuration file defined, the current working directory is used
as the relative directory.

Previoulsy this would raise an :class:`AssertionError`.
Previously this would raise an :class:`AssertionError`.


- `#11475 <https://github.com/pytest-dev/pytest/issues/11475>`_: :ref:`--import-mode=importlib <import-mode-importlib>` now tries to import modules using the standard import mechanism (but still without changing :py:data:`sys.path`), falling back to importing modules directly only if that fails.
Expand Down Expand Up @@ -1411,7 +1411,7 @@ Deprecations
``__init__`` method, they should take ``**kwargs``. See
:ref:`uncooperative-constructors-deprecated` for details.

Note that a deprection warning is only emitted when there is a conflict in the
Note that a deprecation warning is only emitted when there is a conflict in the
arguments pytest expected to pass. This deprecation was already part of pytest
7.0.0rc1 but wasn't documented.

Expand Down Expand Up @@ -1453,7 +1453,7 @@ Breaking Changes
- `#7259 <https://github.com/pytest-dev/pytest/issues/7259>`_: The :ref:`Node.reportinfo() <non-python tests>` function first return value type has been expanded from `py.path.local | str` to `os.PathLike[str] | str`.

Most plugins which refer to `reportinfo()` only define it as part of a custom :class:`pytest.Item` implementation.
Since `py.path.local` is an `os.PathLike[str]`, these plugins are unaffacted.
Since `py.path.local` is an `os.PathLike[str]`, these plugins are unaffected.

Plugins and users which call `reportinfo()`, use the first return value and interact with it as a `py.path.local`, would need to adjust by calling `py.path.local(fspath)`.
Although preferably, avoid the legacy `py.path.local` and use `pathlib.Path`, or use `item.location` or `item.path`, instead.
Expand Down Expand Up @@ -1961,7 +1961,7 @@ Bug Fixes
the ``tmp_path``/``tmpdir`` fixture). Now the directories are created with
private permissions.

pytest used to silently use a pre-existing ``/tmp/pytest-of-<username>`` directory,
pytest used to silently use a preexisting ``/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 @@ -2688,7 +2688,7 @@ Features
also changes ``sys.modules`` as a side-effect), which works but has a number of drawbacks, like requiring test modules
that don't live in packages to have unique names (as they need to reside under a unique name in ``sys.modules``).

``--import-mode=importlib`` uses more fine grained import mechanisms from ``importlib`` which don't
``--import-mode=importlib`` uses more fine-grained import mechanisms from ``importlib`` which don't
require pytest to change ``sys.path`` or ``sys.modules`` at all, eliminating much of the drawbacks
of the previous mode.

Expand All @@ -2705,7 +2705,7 @@ Improvements
------------

- :issue:`4375`: The ``pytest`` command now suppresses the ``BrokenPipeError`` error message that
is printed to stderr when the output of ``pytest`` is piped and and the pipe is
is printed to stderr when the output of ``pytest`` is piped and the pipe is
closed by the piped-to program (common examples are ``less`` and ``head``).


Expand Down Expand Up @@ -3007,7 +3007,7 @@ Breaking Changes
This hook has been marked as deprecated and not been even called by pytest for over 10 years now.


- :issue:`6673`: Reversed / fix meaning of "+/-" in error diffs. "-" means that sth. expected is missing in the result and "+" means that there are unexpected extras in the result.
- :issue:`6673`: Reversed / fix meaning of "+/-" in error diffs. "-" means that something expected is missing in the result and "+" means that there are unexpected extras in the result.


- :issue:`6737`: The ``cached_result`` attribute of ``FixtureDef`` is now set to ``None`` when
Expand Down Expand Up @@ -4612,7 +4612,7 @@ Bug Fixes
Improved Documentation
----------------------

- :issue:`4974`: Update docs for ``pytest_cmdline_parse`` hook to note availability liminations
- :issue:`4974`: Update docs for ``pytest_cmdline_parse`` hook to note availability limitations



Expand Down Expand Up @@ -6470,7 +6470,7 @@ Features
Bug Fixes
---------

- Fix hanging pexpect test on MacOS by using flush() instead of wait().
- Fix hanging pexpect test on macOS by using flush() instead of wait().
(:issue:`2022`)

- Fix restoring Python state after in-process pytest runs with the
Expand Down Expand Up @@ -6518,7 +6518,7 @@ Trivial/Internal Changes
------------------------

- Show a simple and easy error when keyword expressions trigger a syntax error
(for example, ``"-k foo and import"`` will show an error that you can not use
(for example, ``"-k foo and import"`` will show an error that you cannot use
the ``import`` keyword in expressions). (:issue:`2953`)

- Change parametrized automatic test id generation to use the ``__name__``
Expand Down Expand Up @@ -8294,7 +8294,7 @@ time or change existing behaviors in order to make them less surprising/more use
one will also have a "reprec" attribute with the recorded events/reports.

- fix monkeypatch.setattr("x.y", raising=False) to actually not raise
if "y" is not a pre-existing attribute. Thanks Florian Bruhin.
if "y" is not a preexisting attribute. Thanks Florian Bruhin.

- fix issue741: make running output from testdir.run copy/pasteable
Thanks Bruno Oliveira.
Expand Down Expand Up @@ -8350,7 +8350,7 @@ time or change existing behaviors in order to make them less surprising/more use

- fix issue854: autouse yield_fixtures defined as class members of
unittest.TestCase subclasses now work as expected.
Thannks xmo-odoo for the report and Bruno Oliveira for the PR.
Thanks xmo-odoo for the report and Bruno Oliveira for the PR.

- fix issue833: --fixtures now shows all fixtures of collected test files, instead of just the
fixtures declared on the first one.
Expand Down Expand Up @@ -8454,7 +8454,7 @@ time or change existing behaviors in order to make them less surprising/more use
github. See https://pytest.org/en/stable/contributing.html .
Thanks to Anatoly for pushing and initial work on this.

- fix issue650: new option ``--docttest-ignore-import-errors`` which
- fix issue650: new option ``--doctest-ignore-import-errors`` which
will turn import errors in doctests into skips. Thanks Charles Cloud
for the complete PR.

Expand Down Expand Up @@ -8642,7 +8642,7 @@ time or change existing behaviors in order to make them less surprising/more use
- cleanup setup.py a bit and specify supported versions. Thanks Jurko
Gospodnetic for the PR.

- change XPASS colour to yellow rather then red when tests are run
- change XPASS colour to yellow rather than red when tests are run
with -v.

- fix issue473: work around mock putting an unbound method into a class
Expand Down Expand Up @@ -8815,15 +8815,15 @@ time or change existing behaviors in order to make them less surprising/more use
Thanks Ralph Schmitt for the precise failure example.

- fix issue244 by implementing special index for parameters to only use
indices for paramentrized test ids
indices for parametrized test ids

- fix issue287 by running all finalizers but saving the exception
from the first failing finalizer and re-raising it so teardown will
still have failed. We reraise the first failing exception because
it might be the cause for other finalizers to fail.

- fix ordering when mock.patch or other standard decorator-wrappings
are used with test methods. This fixues issue346 and should
are used with test methods. This fixes issue346 and should
help with random "xdist" collection failures. Thanks to
Ronny Pfannschmidt and Donald Stufft for helping to isolate it.

Expand Down Expand Up @@ -9080,7 +9080,7 @@ Bug fixes:
partially failed (finalizers would not always be called before)

- fix issue320 - fix class scope for fixtures when mixed with
module-level functions. Thanks Anatloy Bubenkoff.
module-level functions. Thanks Anatoly Bubenkoff.

- you can specify "-q" or "-qq" to get different levels of "quieter"
reporting (thanks Katarzyna Jachim)
Expand Down Expand Up @@ -9502,7 +9502,7 @@ Bug fixes:
unexpected exceptions
- fix issue47: timing output in junitxml for test cases is now correct
- fix issue48: typo in MarkInfo repr leading to exception
- fix issue49: avoid confusing error when initizaliation partially fails
- fix issue49: avoid confusing error when initialization partially fails
- fix issue44: env/username expansion for junitxml file path
- show releaselevel information in test runs for pypy
- reworked doc pages for better navigation and PDF generation
Expand Down Expand Up @@ -9627,7 +9627,7 @@ Bug fixes:
collection-before-running semantics were not
setup as with pytest 1.3.4. Note, however, that
the recommended and much cleaner way to do test
parametraization remains the "pytest_generate_tests"
parameterization remains the "pytest_generate_tests"
mechanism, see the docs.

2.0.0 (2010-11-25)
Expand Down
2 changes: 1 addition & 1 deletion doc/en/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ Now :class:`~pytest.Class` collects the test methods directly.
Most plugins which reference ``Instance`` do so in order to ignore or skip it,
using a check such as ``if isinstance(node, Instance): return``.
Such plugins should simply remove consideration of ``Instance`` on pytest>=7.
However, to keep such uses working, a dummy type has been instanted in ``pytest.Instance`` and ``_pytest.python.Instance``,
However, to keep such uses working, a dummy type has been instanced in ``pytest.Instance`` and ``_pytest.python.Instance``,
and importing it emits a deprecation warning. This was removed in pytest 8.


Expand Down
2 changes: 1 addition & 1 deletion doc/en/example/customdirectory/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def collect(self):

@pytest.hookimpl
def pytest_collect_directory(path, parent):
# Use our custom collector for directories containing a `mainfest.json` file.
# Use our custom collector for directories containing a `manifest.json` file.
if path.joinpath("manifest.json").is_file():
return ManifestDirectory.from_parent(parent=parent, path=path)
# Otherwise fallback to the standard behavior.
Expand Down
2 changes: 1 addition & 1 deletion doc/en/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Continue reading
Check out additional pytest resources to help you customize tests for your unique workflow:

* ":ref:`usage`" for command line invocation examples
* ":ref:`existingtestsuite`" for working with pre-existing tests
* ":ref:`existingtestsuite`" for working with preexisting tests
* ":ref:`mark`" for information on the ``pytest.mark`` mechanism
* ":ref:`fixtures`" for providing a functional baseline to your tests
* ":ref:`plugins`" for managing and writing plugins
Expand Down
2 changes: 1 addition & 1 deletion doc/en/naming20.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If you used older version of the ``py`` distribution (which
included the py.test command line tool and Python name space)
you accessed helpers and possibly collection classes through
the ``py.test`` Python namespaces. The new ``pytest``
Python module flaty provides the same objects, following
Python module flatly provides the same objects, following
these renaming rules::

py.test.XYZ -> pytest.XYZ
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 @@ -39,7 +39,7 @@ Built-in fixtures
Store and retrieve values across pytest runs.

:fixture:`doctest_namespace`
Provide a dict injected into the docstests namespace.
Provide a dict injected into the doctests namespace.

:fixture:`monkeypatch`
Temporarily modify classes, functions, dictionaries,
Expand Down
2 changes: 1 addition & 1 deletion doc/en/reference/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ All the command-line flags can be obtained by running ``pytest --help``::

general:
-k EXPRESSION Only run tests which match the given substring
expression. An expression is a Python evaluatable
expression. An expression is a Python evaluable
expression where all names are substring-matched
against test names and their parent classes.
Example: -k 'test_method or test_other' matches all
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/_py/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __str__(self) -> str:
3: errno.ENOENT,
17: errno.EEXIST,
18: errno.EXDEV,
13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailiable
13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailable
22: errno.ENOTDIR,
20: errno.ENOTDIR,
267: errno.ENOTDIR,
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/_py/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ def mtime(self) -> float:
def copy(self, target, mode=False, stat=False):
"""Copy path to target.
If mode is True, will copy copy permission from path to target.
If mode is True, will copy permission from path to target.
If stat is True, copy permission, last modification
time, last access time, and flags from path to target.
"""
Expand Down Expand Up @@ -1047,7 +1047,7 @@ def chmod(self, mode, rec=0):
def pypkgpath(self):
"""Return the Python package path by looking for the last
directory upwards which still contains an __init__.py.
Return None if a pkgpath can not be determined.
Return None if a pkgpath cannot be determined.
"""
pkgpath = None
for parent in self.parts(reverse=True):
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 @@ -584,7 +584,7 @@ def _write_and_reset() -> None:
# multi-line assert with message
elif lineno in seen_lines:
lines[-1] = lines[-1][:offset]
# multi line assert with escapd newline before message
# multi line assert with escaped newline before message
else:
lines.append(line[:offset])
_write_and_reset()
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/assertion/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def _diff_text(left: str, right: str, verbose: int = 0) -> List[str]:
def _compare_eq_iterable(
left: Iterable[Any],
right: Iterable[Any],
highligher: _HighlightFunc,
highlighter: _HighlightFunc,
verbose: int = 0,
) -> List[str]:
if verbose <= 0 and not running_on_ci():
Expand All @@ -340,7 +340,7 @@ def _compare_eq_iterable(
# "right" is the expected base against which we compare "left",
# see https://github.com/pytest-dev/pytest/issues/3333
explanation.extend(
highligher(
highlighter(
"\n".join(
line.rstrip()
for line in difflib.ndiff(right_formatting, left_formatting)
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/cacheprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def pytest_make_collect_report(
# Sort any lf-paths to the beginning.
lf_paths = self.lfplugin._last_failed_paths

# Use stable sort to priorize last failed.
# Use stable sort to prioritize last failed.
def sort_key(node: Union[nodes.Item, nodes.Collector]) -> bool:
return node.path in lf_paths

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def iscoroutinefunction(func: object) -> bool:
def syntax, and doesn't contain yield), or a function decorated with
@asyncio.coroutine.
Note: copied and modified from Python 3.5's builtin couroutines.py to avoid
Note: copied and modified from Python 3.5's builtin coroutines.py to avoid
importing asyncio directly, which in turns also initializes the "logging"
module as a side-effect (see issue #8).
"""
Expand Down
6 changes: 3 additions & 3 deletions src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def parse_hookimpl_opts(
# (see issue #1073).
if not name.startswith("pytest_"):
return None
# Ignore names which can not be hooks.
# Ignore names which cannot be hooks.
if name == "pytest_plugins":
return None

Expand Down Expand Up @@ -574,8 +574,8 @@ def _set_initial_conftests(
self._noconftest = noconftest
self._using_pyargs = pyargs
foundanchor = False
for intitial_path in args:
path = str(intitial_path)
for initial_path in args:
path = str(initial_path)
# remove node-id syntax
i = path.find("::")
if i != -1:
Expand Down

0 comments on commit 8d00811

Please sign in to comment.