benji-york / manuel

Manuel lets you mix and match traditional doctests with custom test syntax.
Apache License 2.0
18 stars 15 forks source link

Test failures with Python 3.11.0b1 #30

Open mgorny opened 2 years ago

mgorny commented 2 years ago

There is one test failure due to test output changes in Python 3.11.0b1:

$ tox -e py311
GLOB sdist-make: /tmp/manuel/setup.py
py311 create: /tmp/manuel/.tox/py311
py311 installdeps: coverage, zope.testing
py311 inst: /tmp/manuel/.tox/.tmp/package/1/manuel-1.11.2.zip
py311 installed: coverage==6.3.3,manuel @ file:///tmp/manuel/.tox/.tmp/package/1/manuel-1.11.2.zip,six==1.16.0,zope.testing==4.10
py311 run-test-pre: PYTHONHASHSEED='1269705516'
py311 run-test: commands[0] | coverage run setup.py test -q
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing src/manuel.egg-info/PKG-INFO
writing dependency_links to src/manuel.egg-info/dependency_links.txt
writing requirements to src/manuel.egg-info/requires.txt
writing top-level names to src/manuel.egg-info/top_level.txt
reading manifest file 'src/manuel.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'docs'
adding license file 'LICENSE.rst'
writing manifest file 'src/manuel.egg-info/SOURCES.txt'
running build_ext
*** suite_rst. tests ['index.txt', 'table-example.txt', 'README.txt', 'bugs.txt', 'capture.txt', 'myst-markdown.md']
*** suite_myst. tests ['myst-markdown.md']
......F.......................................................
======================================================================
FAIL: /tmp/manuel/src/manuel/index.txt:Others
/tmp/manuel/src/manuel/index.txt:Others
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/manuel/src/manuel/testing.py", line 46, in runTest
    raise real_doctest.DocTestCase.failureException(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 
----------------------------------------------------------------------
File "/tmp/manuel/src/manuel/index.txt", line 214, in index.txt
Failed example:
    result = suite.run(unittest.TextTestResult(sys.stdout, True, 3))
Expected:
    test1 (tests.MyTest) ... ok
    test2 (tests.MyTest) ... ok
    test3 (tests.MyTest) ... FAIL
Got:
    test1 (tests.MyTest.test1) ... ok
    test2 (tests.MyTest.test2) ... ok
    test3 (tests.MyTest.test3) ... FAIL

----------------------------------------------------------------------
Ran 62 tests in 0.328s

FAILED (failures=1)
Test failed: <unittest.runner.TextTestResult run=62 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=62 errors=0 failures=1>
ERROR: InvocationError for command /tmp/manuel/.tox/py311/bin/coverage run setup.py test -q (exited with code 1)
_______________________________________________________________ summary _______________________________________________________________
ERROR:   py311: commands failed
Kangie commented 2 years ago

Looked into this - what's happened is that upstream has changed the way that unittest returns tests, so this behaviour is expected.

Bug: https://bugs.python.org/issue14265