diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b36a77d77..fb00b0d0e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1206,7 +1206,7 @@ Changes * Testcase reports with a ``url`` attribute will now properly write this to junitxml. Thanks `@fushi`_ for the PR (`#1874`_). -* Remove common items from dict comparision output when verbosity=1. Also update +* Remove common items from dict comparison output when verbosity=1. Also update the truncation message to make it clearer that pytest truncates all assertion messages if verbosity < 2 (`#1512`_). Thanks `@mattduck`_ for the PR @@ -1218,7 +1218,7 @@ Changes * fix `#2013`_: turn RecordedWarning into ``namedtuple``, to give it a comprehensible repr while preventing unwarranted modification. -* fix `#2208`_: ensure a iteration limit for _pytest.compat.get_real_func. +* fix `#2208`_: ensure an iteration limit for _pytest.compat.get_real_func. Thanks `@RonnyPfannschmidt`_ for the report and PR. * Hooks are now verified after collection is complete, rather than right after loading installed plugins. This @@ -1322,7 +1322,7 @@ Bug Fixes Notably, importing the ``anydbm`` module is fixed. (`#2248`_). Thanks `@pfhayes`_ for the PR. -* junitxml: Fix problematic case where system-out tag occured twice per testcase +* junitxml: Fix problematic case where system-out tag occurred twice per testcase element in the XML report. Thanks `@kkoukiou`_ for the PR. * Fix regression, pytest now skips unittest correctly if run with ``--pdb`` @@ -2918,7 +2918,7 @@ time or change existing behaviors in order to make them less surprising/more use "::" node id specifications (copy pasted from "-v" output) - fix issue544 by only removing "@NUM" at the end of "::" separated parts - and if the part has an ".py" extension + and if the part has a ".py" extension - don't use py.std import helper, rather import things directly. Thanks Bruno Oliveira. @@ -3189,7 +3189,7 @@ time or change existing behaviors in order to make them less surprising/more use would not work correctly because pytest assumes @pytest.mark.some gets a function to be decorated already. We now at least detect if this - arg is an lambda and thus the example will work. Thanks Alex Gaynor + arg is a lambda and thus the example will work. Thanks Alex Gaynor for bringing it up. - xfail a test on pypy that checks wrong encoding/ascii (pypy does @@ -3502,7 +3502,7 @@ Bug fixes: rather use the post-2.0 parametrize features instead of yield, see: http://pytest.org/latest/example/parametrize.html - fix autouse-issue where autouse-fixtures would not be discovered - if defined in a a/conftest.py file and tests in a/tests/test_some.py + if defined in an a/conftest.py file and tests in a/tests/test_some.py - fix issue226 - LIFO ordering for fixture teardowns - fix issue224 - invocations with >256 char arguments now work - fix issue91 - add/discuss package/directory level setups in example @@ -4072,7 +4072,7 @@ Bug fixes: - make path.bestrelpath(path) return ".", note that when calling X.bestrelpath the assumption is that X is a directory. - make initial conftest discovery ignore "--" prefixed arguments -- fix resultlog plugin when used in an multicpu/multihost xdist situation +- fix resultlog plugin when used in a multicpu/multihost xdist situation (thanks Jakub Gustak) - perform distributed testing related reporting in the xdist-plugin rather than having dist-related code in the generic py.test diff --git a/_pytest/_code/source.py b/_pytest/_code/source.py index cb5e13f05..6c2856ea8 100644 --- a/_pytest/_code/source.py +++ b/_pytest/_code/source.py @@ -14,7 +14,7 @@ cpy_compile = compile class Source(object): - """ a immutable object holding a source code fragment, + """ an immutable object holding a source code fragment, possibly deindenting it. """ _compilecounter = 0 diff --git a/_pytest/capture.py b/_pytest/capture.py index 9f4f41c41..d71f59ac2 100644 --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -315,7 +315,7 @@ class CaptureFixture(object): def safe_text_dupfile(f, mode, default_encoding="UTF8"): - """ return a open text file object that's a duplicate of f on the + """ return an open text file object that's a duplicate of f on the FD-level if possible. """ encoding = getattr(f, "encoding", None) diff --git a/_pytest/compat.py b/_pytest/compat.py index a5fa03719..e5c8c3940 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -257,7 +257,7 @@ def safe_getattr(object, name, default): def _is_unittest_unexpected_success_a_failure(): - """Return if the test suite should fail if a @expectedFailure unittest test PASSES. + """Return if the test suite should fail if an @expectedFailure unittest test PASSES. From https://docs.python.org/3/library/unittest.html?highlight=unittest#unittest.TestResult.wasSuccessful: Changed in version 3.4: Returns False if there were any diff --git a/_pytest/doctest.py b/_pytest/doctest.py index 131109cba..4511f5889 100644 --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -24,7 +24,7 @@ DOCTEST_REPORT_CHOICES = ( DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE, ) -# Lazy definiton of runner class +# Lazy definition of runner class RUNNER_CLASS = None diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index 2ac340e6f..dbefbab71 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -290,7 +290,7 @@ class FixtureRequest(FuncargnamesCompatAttr): def _getnextfixturedef(self, argname): fixturedefs = self._arg2fixturedefs.get(argname, None) if fixturedefs is None: - # we arrive here because of a a dynamic call to + # we arrive here because of a dynamic call to # getfixturevalue(argname) usage which was naturally # not known at parsing/collection time parentid = self._pyfuncitem.parent.nodeid @@ -1026,7 +1026,7 @@ class FixtureManager(object): def getfixtureclosure(self, fixturenames, parentnode): # collect the closure of all fixtures , starting with the given # fixturenames as the initial set. As we have to visit all - # factory definitions anyway, we also return a arg2fixturedefs + # factory definitions anyway, we also return an arg2fixturedefs # mapping so that the caller can reuse it and does not have # to re-discover fixturedefs again for each fixturename # (discovering matching fixtures for a given name/node is expensive) diff --git a/_pytest/main.py b/_pytest/main.py index 03db67b60..6c4bd65bb 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -90,7 +90,7 @@ def pytest_addoption(parser): def pytest_configure(config): - __import__('pytest').config = config # compatibiltiy + __import__('pytest').config = config # compatibility def wrap_session(config, doit): @@ -290,7 +290,7 @@ class Interrupted(KeyboardInterrupt): class Failed(Exception): - """ signals an stop as failed test run. """ + """ signals a stop as failed test run. """ class Session(nodes.FSCollector): diff --git a/_pytest/mark/structures.py b/_pytest/mark/structures.py index a0d4a5ce7..24c4880cd 100644 --- a/_pytest/mark/structures.py +++ b/_pytest/mark/structures.py @@ -204,7 +204,7 @@ class MarkDecorator(object): def get_unpacked_marks(obj): """ - obtain the unpacked marks that are stored on a object + obtain the unpacked marks that are stored on an object """ mark_list = getattr(obj, 'pytestmark', []) @@ -217,7 +217,7 @@ def get_unpacked_marks(obj): def store_mark(obj, mark): - """store a Mark on a object + """store a Mark on an object this is used to implement the Mark declarations/decorators correctly """ assert isinstance(mark, Mark), mark diff --git a/_pytest/outcomes.py b/_pytest/outcomes.py index 7f0c18fa6..640c5773a 100644 --- a/_pytest/outcomes.py +++ b/_pytest/outcomes.py @@ -83,7 +83,7 @@ skip.Exception = Skipped def fail(msg="", pytrace=True): - """ explicitly fail an currently-executing test with the given Message. + """ explicitly fail a currently-executing test with the given Message. :arg pytrace: if false the msg represents the full failure information and no python traceback will be reported. diff --git a/_pytest/python.py b/_pytest/python.py index 4c0340d6e..dd27de504 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -55,7 +55,7 @@ def filter_traceback(entry): is_generated = '<' in raw_filename and '>' in raw_filename if is_generated: return False - # entry.path might point to an non-existing file, in which case it will + # entry.path might point to a non-existing file, in which case it will # also return a str object. see #1133 p = py.path.local(entry.path) return not p.relto(_pluggy_dir) and not p.relto(_pytest_dir) and not p.relto(_py_dir) diff --git a/doc/en/announce/release-2.3.4.rst b/doc/en/announce/release-2.3.4.rst index d6c597b54..fc5f361d5 100644 --- a/doc/en/announce/release-2.3.4.rst +++ b/doc/en/announce/release-2.3.4.rst @@ -18,7 +18,7 @@ comes with the following fixes and features: rather use the post-2.0 parametrize features instead of yield, see: http://pytest.org/latest/example/parametrize.html - fix autouse-issue where autouse-fixtures would not be discovered - if defined in a a/conftest.py file and tests in a/tests/test_some.py + if defined in an a/conftest.py file and tests in a/tests/test_some.py - fix issue226 - LIFO ordering for fixture teardowns - fix issue224 - invocations with >256 char arguments now work - fix issue91 - add/discuss package/directory level setups in example diff --git a/doc/en/announce/release-2.6.1.rst b/doc/en/announce/release-2.6.1.rst index 6f27c5861..2f3257cd8 100644 --- a/doc/en/announce/release-2.6.1.rst +++ b/doc/en/announce/release-2.6.1.rst @@ -52,7 +52,7 @@ Changes 2.6.1 "::" node id specifications (copy pasted from "-v" output) - fix issue544 by only removing "@NUM" at the end of "::" separated parts - and if the part has an ".py" extension + and if the part has a ".py" extension - don't use py.std import helper, rather import things directly. Thanks Bruno Oliveira. diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 073f7fb88..2cf3fa1e4 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -469,7 +469,7 @@ If you run this with reporting for skips enabled:: =================== 1 passed, 1 skipped in 0.12 seconds ==================== -You'll see that we don't have a ``opt2`` module and thus the second test run +You'll see that we don't have an ``opt2`` module and thus the second test run of our ``test_func1`` was skipped. A few notes: - the fixture functions in the ``conftest.py`` file are "session-scoped" because we diff --git a/doc/en/goodpractices.rst b/doc/en/goodpractices.rst index 490ecadd6..d9f0fff11 100644 --- a/doc/en/goodpractices.rst +++ b/doc/en/goodpractices.rst @@ -145,7 +145,7 @@ Note that this layout also works in conjunction with the ``src`` layout mentione .. note:: - If ``pytest`` finds a "a/b/test_module.py" test file while + If ``pytest`` finds an "a/b/test_module.py" test file while recursing into the filesystem it determines the import name as follows: diff --git a/doc/en/reference.rst b/doc/en/reference.rst index ef7f8f51f..a5a114bf1 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -933,8 +933,8 @@ passed multiple times. The expected format is ``name=value``. For example:: Allows to pick the action for empty parametersets in parameterization - * ``skip`` skips tests with a empty parameterset (default) - * ``xfail`` marks tests with a empty parameterset as xfail(run=False) + * ``skip`` skips tests with an empty parameterset (default) + * ``xfail`` marks tests with an empty parameterset as xfail(run=False) .. code-block:: ini diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 6b4adf001..8fd59423f 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -1198,7 +1198,7 @@ def test_cwd_deleted(testdir): def test_exception_repr_extraction_error_on_recursion(): """ Ensure we can properly detect a recursion error even - if some locals raise error on comparision (#2459). + if some locals raise error on comparison (#2459). """ class numpy_like(object): diff --git a/testing/python/fixture.py b/testing/python/fixture.py index 10eb00602..1e37d78d9 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -1553,7 +1553,7 @@ class TestAutouseDiscovery(object): def test_callables_nocode(self, testdir): """ - a imported mock.call would break setup/factory discovery + an imported mock.call would break setup/factory discovery due to it being callable and __code__ not being a code object """ testdir.makepyfile(""" diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 341090580..51229d3e1 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -473,7 +473,7 @@ class TestAssert_reprcompare(object): def test_one_repr_empty(self): """ the faulty empty string repr did trigger - a unbound local error in _diff_text + an unbound local error in _diff_text """ class A(str): def __repr__(self): diff --git a/testing/test_capture.py b/testing/test_capture.py index 7fccc055d..bc8ae6534 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -998,7 +998,7 @@ class TestStdCapture(object): reason='text output different for bytes on python3') def test_capturing_readouterr_decode_error_handling(self): with self.getcapture() as cap: - # triggered a internal error in pytest + # triggered an internal error in pytest print('\xa6') out, err = cap.readouterr() assert out == py.builtin._totext('\ufffd\n', 'unicode-escape') diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 6566f752a..93bf8ea8d 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -373,7 +373,7 @@ class TestConftestVisibility(object): (None, 1, 1), ]) def test_search_conftest_up_to_inifile(testdir, confcutdir, passed, error): - """Test that conftest files are detected only up to a ini file, unless + """Test that conftest files are detected only up to an ini file, unless an explicit --confcutdir option is given. """ root = testdir.tmpdir diff --git a/testing/test_nose.py b/testing/test_nose.py index df3e1a94b..1964b06c5 100644 --- a/testing/test_nose.py +++ b/testing/test_nose.py @@ -289,7 +289,7 @@ def test_nose_setup_ordering(testdir): def test_apiwrapper_problem_issue260(testdir): - # this would end up trying a call a optional teardown on the class + # this would end up trying a call an optional teardown on the class # for plain unittests we dont want nose behaviour testdir.makepyfile(""" import unittest