One test fails on Py 3.5.4 that passed on 3.5.3

Issue #628 resolved
Ned Batchelder
repo owner created an issue

When running the test suite at commit ee6280d56cc9, one test fails under Python 3.5.4 that passed on 3.5.3 (and earlier versions of 3.5.x). The entries in sys.path are in a slightly different order. I don't know why.

$ tox -e py35
py35 recreate: /Users/ned/coverage/trunk/.tox/py35
py35 installdeps: -rrequirements/pytest.pip, pip==9.0.1, setuptools==35.0.2, mock==2.0.0, PyContracts==1.8.0, unittest-mixins==1.4, gevent==1.2.2, eventlet==0.21.0, greenlet==0.4.12
py35 develop-inst: /Users/ned/coverage/trunk
py35 installed: apipkg==1.4,appdirs==1.4.3,-e hg+ssh://hg@bitbucket.org/ned/coveragepy@ee6280d56cc94f56cbd30b08e73d3e999e9d9831#egg=coverage,decorator==4.1.2,enum-compat==0.0.2,eventlet==0.21.0,execnet==1.5.0,flaky==3.4.0,gevent==1.2.2,greenlet==0.4.12,mock==2.0.0,packaging==16.8,pbr==3.1.1,py==1.5.2,PyContracts==1.8.0,pyparsing==2.2.0,pytest==3.2.5,pytest-forked==0.2,pytest-xdist==1.20.1,six==1.11.0,unittest-mixins==1.4
py35 runtests: PYTHONHASHSEED='192351603'
py35 runtests: commands[0] | python setup.py --quiet clean develop
no previously-included directories found matching 'tests/eggsrc/dist'
no previously-included directories found matching 'tests/eggsrc/*.egg-info'
py35 runtests: commands[1] | python igor.py zip_mods install_egg remove_extension
py35 runtests: commands[2] | python igor.py test_with_tracer py
=== CPython 3.5.4 with Python tracer (.tox/py35/bin/python) ===
gw0 [769] / gw1 [769] / gw2 [769]
scheduling tests via LoadScheduling
........................................................................................................................................................................................................s..s.........................................................................................................................................................s..................................................................................................................................................s..............sssssssssssssssss...s....s..s.......................................................................Fs................................s.......s...........................................................................................................
============================================================================================ FAILURES ============================================================================================
____________________________________________________________________ EnvironmentTest.test_coverage_run_dir_is_like_python_dir ____________________________________________________________________
[gw2] darwin -- Python 3.5.4 /Users/ned/coverage/trunk/.tox/py35/bin/python

self = <tests.test_process.EnvironmentTest testMethod=test_coverage_run_dir_is_like_python_dir>

    def test_coverage_run_dir_is_like_python_dir(self):
        with open(TRY_EXECFILE) as f:
            self.make_file("with_main/__main__.py", f.read())

        out_cov = self.run_command("coverage run with_main")
        out_py = self.run_command("python with_main")

        # The coverage.py results are not identical to the Python results, and
        # I don't know why.  For now, ignore those failures. If someone finds
        # a real problem with the discrepancies, we can work on it some more.
        ignored = r"__file__|__loader__|__package__"
        # PyPy includes the current directory in the path when running a
        # directory, while CPython and coverage.py do not.  Exclude that from
        # the comparison also...
        if env.PYPY:
            ignored += "|"+re.escape(os.getcwd())
        out_cov = re_lines(out_cov, ignored, match=False)
        out_py = re_lines(out_py, ignored, match=False)
>       self.assert_tryexecfile_output(out_cov, out_py)

tests/test_process.py:725:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_process.py:692: in assert_tryexecfile_output
    self.assertMultiLineEqual(out1, out2)
E   AssertionError: '{\n [2632 chars]   "/Users/ned/coverage/trunk",\n        "/pri[711 chars]n}\n' != '{\n [2632 chars]   "/private/var/folders/j2/gr3cj3jn63s5q8g3bj[711 chars]n}\n'
E     {
E         "DATA": "xyzzy",
E         "FN_VAL": "my_fn('fooey')",
E         "__builtins__.dir": [
E             "ArithmeticError AssertionError AttributeError BaseException BlockingIOError BrokenPipeError BufferError BytesWarning",
E             "ChildProcessError ConnectionAbortedError ConnectionError ConnectionRefusedError ConnectionResetError DeprecationWarning",
E             "EOFError Ellipsis EnvironmentError Exception False FileExistsError FileNotFoundError FloatingPointError FutureWarning",
E             "GeneratorExit",
E             "IOError ImportError ImportWarning IndentationError IndexError InterruptedError IsADirectoryError",
E             "KeyError KeyboardInterrupt LookupError",
E             "MemoryError NameError None NotADirectoryError NotImplemented NotImplementedError",
E             "OSError OverflowError PendingDeprecationWarning PermissionError ProcessLookupError",
E             "RecursionError ReferenceError ResourceWarning RuntimeError RuntimeWarning",
E             "StopAsyncIteration StopIteration SyntaxError SyntaxWarning SystemError SystemExit TabError TimeoutError True TypeError",
E             "UnboundLocalError UnicodeDecodeError UnicodeEncodeError UnicodeError UnicodeTranslateError UnicodeWarning UserWarning ValueError",
E             "Warning",
E             "ZeroDivisionError",
E             "abs all any ascii bin bool bytearray bytes",
E             "callable chr classmethod compile complex copyright credits delattr dict dir divmod",
E             "enumerate eval exec exit filter float format frozenset",
E             "getattr globals hasattr hash help hex",
E             "id input int isinstance issubclass iter",
E             "len license list locals",
E             "map max memoryview min next",
E             "object oct open ord pow print property",
E             "quit range repr reversed round",
E             "set setattr slice sorted staticmethod str sum super tuple type",
E             "vars",
E             "zip"
E         ],
E         "__builtins__.has_open": true,
E         "__doc__": "Test file for run_python_file.\n\nThis file is executed two ways::\n\n    $ coverage run try_execfile.py\n\nand::\n\n    $ python try_execfile.py\n\nThe output is compared to see that the program execution context is the same\nunder coverage and under Python.\n\nIt is not crucial that the execution be identical, there are some differences\nthat are OK.  This program canonicalizes the output to gloss over those\ndifferences and get a clean diff.\n\n",
E         "__main__.DATA": "xyzzy",
E         "__name__": "__main__",
E         "argv0": "with_main",
E         "argv1-n": [],
E         "os.getcwd": "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/test_cover_86396058",
E         "path": [
E             "with_main",
E   +         "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/test_cover_86396058",
E             "/Users/ned/coverage/trunk",
E   -         "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/test_cover_86396058",
E             "/Users/ned/coverage/trunk/tests/modules",
E             "/Users/ned/coverage/trunk/tests/zipmods.zip",
E             "/Users/ned/coverage/trunk/.tox/py35/lib/python35.zip",
E             "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5",
E             "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/plat-darwin",
E             "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/lib-dynload",
E             "/usr/local/pythonz/pythons/CPython-3.5.4/lib/python3.5",
E             "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/site-packages",
E             "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/site-packages/covtestegg1-0.0.0-py2.6.egg"
E         ]
E     }
-------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------
{
    "DATA": "xyzzy",
    "FN_VAL": "my_fn('fooey')",
    "__builtins__.dir": [
        "ArithmeticError AssertionError AttributeError BaseException BlockingIOError BrokenPipeError BufferError BytesWarning",
        "ChildProcessError ConnectionAbortedError ConnectionError ConnectionRefusedError ConnectionResetError DeprecationWarning",
        "EOFError Ellipsis EnvironmentError Exception False FileExistsError FileNotFoundError FloatingPointError FutureWarning",
        "GeneratorExit",
        "IOError ImportError ImportWarning IndentationError IndexError InterruptedError IsADirectoryError",
        "KeyError KeyboardInterrupt LookupError",
        "MemoryError NameError None NotADirectoryError NotImplemented NotImplementedError",
        "OSError OverflowError PendingDeprecationWarning PermissionError ProcessLookupError",
        "RecursionError ReferenceError ResourceWarning RuntimeError RuntimeWarning",
        "StopAsyncIteration StopIteration SyntaxError SyntaxWarning SystemError SystemExit TabError TimeoutError True TypeError",
        "UnboundLocalError UnicodeDecodeError UnicodeEncodeError UnicodeError UnicodeTranslateError UnicodeWarning UserWarning ValueError",
        "Warning",
        "ZeroDivisionError",
        "__build_class__ __debug__ __doc__ __import__ __loader__ __name__ __package__ __spec__",
        "abs all any ascii bin bool bytearray bytes",
        "callable chr classmethod compile complex copyright credits delattr dict dir divmod",
        "enumerate eval exec exit filter float format frozenset",
        "getattr globals hasattr hash help hex",
        "id input int isinstance issubclass iter",
        "len license list locals",
        "map max memoryview min next",
        "object oct open ord pow print property",
        "quit range repr reversed round",
        "set setattr slice sorted staticmethod str sum super tuple type",
        "vars",
        "zip"
    ],
    "__builtins__.has_open": true,
    "__doc__": "Test file for run_python_file.\n\nThis file is executed two ways::\n\n    $ coverage run try_execfile.py\n\nand::\n\n    $ python try_execfile.py\n\nThe output is compared to see that the program execution context is the same\nunder coverage and under Python.\n\nIt is not crucial that the execution be identical, there are some differences\nthat are OK.  This program canonicalizes the output to gloss over those\ndifferences and get a clean diff.\n\n",
    "__file__": "with_main",
    "__loader__ exists": true,
    "__loader__.fullname": "__main__",
    "__main__.DATA": "xyzzy",
    "__name__": "__main__",
    "__package__": null,
    "argv0": "with_main",
    "argv1-n": [],
    "os.getcwd": "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/test_cover_86396058",
    "path": [
        "with_main",
        "/Users/ned/coverage/trunk",
        "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/test_cover_86396058",
        "/Users/ned/coverage/trunk/tests/modules",
        "/Users/ned/coverage/trunk/tests/zipmods.zip",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python35.zip",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/plat-darwin",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/lib-dynload",
        "/usr/local/pythonz/pythons/CPython-3.5.4/lib/python3.5",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/site-packages",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/site-packages/covtestegg1-0.0.0-py2.6.egg"
    ]
}

{
    "DATA": "xyzzy",
    "FN_VAL": "my_fn('fooey')",
    "__builtins__.dir": [
        "ArithmeticError AssertionError AttributeError BaseException BlockingIOError BrokenPipeError BufferError BytesWarning",
        "ChildProcessError ConnectionAbortedError ConnectionError ConnectionRefusedError ConnectionResetError DeprecationWarning",
        "EOFError Ellipsis EnvironmentError Exception False FileExistsError FileNotFoundError FloatingPointError FutureWarning",
        "GeneratorExit",
        "IOError ImportError ImportWarning IndentationError IndexError InterruptedError IsADirectoryError",
        "KeyError KeyboardInterrupt LookupError",
        "MemoryError NameError None NotADirectoryError NotImplemented NotImplementedError",
        "OSError OverflowError PendingDeprecationWarning PermissionError ProcessLookupError",
        "RecursionError ReferenceError ResourceWarning RuntimeError RuntimeWarning",
        "StopAsyncIteration StopIteration SyntaxError SyntaxWarning SystemError SystemExit TabError TimeoutError True TypeError",
        "UnboundLocalError UnicodeDecodeError UnicodeEncodeError UnicodeError UnicodeTranslateError UnicodeWarning UserWarning ValueError",
        "Warning",
        "ZeroDivisionError",
        "__build_class__ __debug__ __doc__ __import__ __loader__ __name__ __package__ __spec__",
        "abs all any ascii bin bool bytearray bytes",
        "callable chr classmethod compile complex copyright credits delattr dict dir divmod",
        "enumerate eval exec exit filter float format frozenset",
        "getattr globals hasattr hash help hex",
        "id input int isinstance issubclass iter",
        "len license list locals",
        "map max memoryview min next",
        "object oct open ord pow print property",
        "quit range repr reversed round",
        "set setattr slice sorted staticmethod str sum super tuple type",
        "vars",
        "zip"
    ],
    "__builtins__.has_open": true,
    "__doc__": "Test file for run_python_file.\n\nThis file is executed two ways::\n\n    $ coverage run try_execfile.py\n\nand::\n\n    $ python try_execfile.py\n\nThe output is compared to see that the program execution context is the same\nunder coverage and under Python.\n\nIt is not crucial that the execution be identical, there are some differences\nthat are OK.  This program canonicalizes the output to gloss over those\ndifferences and get a clean diff.\n\n",
    "__file__": "with_main/__main__.py",
    "__loader__ exists": true,
    "__loader__.fullname": "__main__",
    "__main__.DATA": "xyzzy",
    "__name__": "__main__",
    "__package__": "",
    "argv0": "with_main",
    "argv1-n": [],
    "os.getcwd": "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/test_cover_86396058",
    "path": [
        "with_main",
        "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/test_cover_86396058",
        "/Users/ned/coverage/trunk",
        "/Users/ned/coverage/trunk/tests/modules",
        "/Users/ned/coverage/trunk/tests/zipmods.zip",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python35.zip",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/plat-darwin",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/lib-dynload",
        "/usr/local/pythonz/pythons/CPython-3.5.4/lib/python3.5",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/site-packages",
        "/Users/ned/coverage/trunk/.tox/py35/lib/python3.5/site-packages/covtestegg1-0.0.0-py2.6.egg"
    ]
}

1 failed, 741 passed, 27 skipped in 83.93 seconds
ERROR: InvocationError: '/Users/ned/coverage/trunk/.tox/py35/bin/python igor.py test_with_tracer py'
____________________________________________________________________________________________ summary _____________________________________________________________________________________________
ERROR:   py35: commands failed

Comments (4)

  1. Log in to comment