Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 #2

Open
jayvdb opened this issue Nov 27, 2022 · 2 comments
Open

Python 3.11 #2

jayvdb opened this issue Nov 27, 2022 · 2 comments

Comments

@jayvdb
Copy link
Owner

jayvdb commented Nov 27, 2022

Tests fail on Python 3.11

@drnlm
Copy link

drnlm commented Dec 13, 2022

Debian has added 2 patches to address this that you may want to look at:

https://salsa.debian.org/python-team/packages/nose/-/blob/debian/master/debian/patches/python3.11-testcase-str.diff
and
https://salsa.debian.org/python-team/packages/nose/-/blob/debian/master/debian/patches/python3.11.diff

@jayvdb
Copy link
Owner Author

jayvdb commented Feb 11, 2024

log of failures

python selftest.py
F......................F..F......F.....F......nose.plugins.cover: ERROR: TOTAL Coverage did not reach minimum required: 100%
.nose.plugins.cover: ERROR: TOTAL Coverage did not reach minimum required: 100%
.nose.plugins.cover: ERROR: TOTAL Coverage did not reach minimum required: 100%
.nose.plugins.cover: ERROR: TOTAL Coverage did not reach minimum required: 100%
./home/jayvdb/python/nose3/.tox/py311/lib64/python3.11/site-packages/coverage/inorout.py:519: CoverageWarning: Module moo was previously imported, but not measured (module-not-measured)
  self.warn(msg, slug="module-not-measured")
nose.plugins.cover: ERROR: TOTAL Coverage did not reach minimum required: 100%
................................................F...........................................S..........F....................................................................................S...............................................................................SSSS........................................................................../home/jayvdb/python/nose3/.tox/py311/lib/python3.11/site-packages/setuptools/_distutils/log.py:46: UserWarning: distutils.log.Log is deprecated, please use an alternative from `logging`.
  warnings.warn(Log.__doc__)  # avoid DeprecationWarning to ensure warn is shown
Test
..........
======================================================================
FAIL: Doctest: nose.plugins.errorclass
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.11/doctest.py", line 2241, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for nose.plugins.errorclass
  File "/home/jayvdb/python/nose3/nose/plugins/errorclass.py", line 0, in errorclass

----------------------------------------------------------------------
File "/home/jayvdb/python/nose3/nose/plugins/errorclass.py", line 68, in nose.plugins.errorclass
Failed example:
    _ = case(result) # doctest: +ELLIPSIS
Expected:
    runTest (....TestTodo) ... TODO: I need to test something
Got:
    runTest (nose.plugins.errorclass.TestTodo.runTest) ... TODO: I need to test something
----------------------------------------------------------------------
File "/home/jayvdb/python/nose3/nose/plugins/errorclass.py", line 79, in nose.plugins.errorclass
Failed example:
    result.printErrors() # doctest: +ELLIPSIS
Expected:
    <BLANKLINE>
    ======================================================================
    TODO: runTest (....TestTodo)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    ...
    ...Todo: I need to test something
    <BLANKLINE>
Got:
    <BLANKLINE>
    ======================================================================
    TODO: runTest (nose.plugins.errorclass.TestTodo.runTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "<doctest nose.plugins.errorclass[7]>", line 3, in runTest
        raise Todo("I need to test something")
    nose.plugins.errorclass.Todo: I need to test something
    <BLANKLINE>


======================================================================
FAIL: Doctest: imported_tests.rst
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.11/doctest.py", line 2241, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for imported_tests.rst
  File "/home/jayvdb/python/nose3/functional_tests/doc_tests/test_issue145/imported_tests.rst", line 0

----------------------------------------------------------------------
File "/home/jayvdb/python/nose3/functional_tests/doc_tests/test_issue145/imported_tests.rst", line 43, in imported_tests.rst
Failed example:
    run(argv=argv) # doctest: +REPORT_NDIFF
Differences (ndiff with -expected +actual):
      package1 setup
    - test (package1.test_module.TestCase) ... ok
    + test (package1.test_module.TestCase.test) ... ok
    ?                                    +++++
      package1.test_module.TestClass.test_class ... ok
      package1.test_module.test_function ... ok
      package2c setup
    - test (package2c.test_module.TestCase) ... ok
    + test (package2c.test_module.TestCase.test) ... ok
    ?                                     +++++
      package2c.test_module.TestClass.test_class ... ok
      package2f setup
      package2f.test_module.test_function ... ok
      <BLANKLINE>
      ----------------------------------------------------------------------
      Ran 6 tests in ...s
      <BLANKLINE>
      OK
----------------------------------------------------------------------
File "/home/jayvdb/python/nose3/functional_tests/doc_tests/test_issue145/imported_tests.rst", line 72, in imported_tests.rst
Failed example:
    run(argv=argv) # doctest: +REPORT_NDIFF
Differences (ndiff with -expected +actual):
      package2c setup
    - test (package2c.test_module.TestCase) ... ok
    + test (package2c.test_module.TestCase.test) ... ok
    ?                                     +++++
      package2c.test_module.TestClass.test_class ... ok
      <BLANKLINE>
      ----------------------------------------------------------------------
      Ran 2 tests in ...s
      <BLANKLINE>
      OK
----------------------------------------------------------------------
File "/home/jayvdb/python/nose3/functional_tests/doc_tests/test_issue145/imported_tests.rst", line 99, in imported_tests.rst
Failed example:
    run(argv=argv) # doctest: +REPORT_NDIFF
Differences (ndiff with -expected +actual):
      package2c setup
    - test (package2c.test_module.TestCase) ... ok
    + test (package2c.test_module.TestCase.test) ... ok
    ?                                     +++++
      <BLANKLINE>
      ----------------------------------------------------------------------
      Ran 1 test in ...s
      <BLANKLINE>
      OK


======================================================================
FAIL: Doctest: selector_plugin.rst
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.11/doctest.py", line 2241, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for selector_plugin.rst
  File "/home/jayvdb/python/nose3/functional_tests/doc_tests/test_selector_plugin/selector_plugin.rst", line 0

----------------------------------------------------------------------
File "/home/jayvdb/python/nose3/functional_tests/doc_tests/test_selector_plugin/selector_plugin.rst", line 110, in selector_plugin.rst
Failed example:
    run(argv=argv, plugins=[UseMySelector()])
Expected:
    test_add (basic.TestBasicMath) ... ok
    test_sub (basic.TestBasicMath) ... ok
    test_tuple_groups (my_function.MyFunction) ... ok
    test_cat (cat.StringsCat) ... ok
    <BLANKLINE>
    ----------------------------------------------------------------------
    Ran 4 tests in ...s
    <BLANKLINE>
    OK
Got:
    test_add (basic.TestBasicMath.test_add) ... ok
    test_sub (basic.TestBasicMath.test_sub) ... ok
    test_tuple_groups (my_function.MyFunction.test_tuple_groups) ... ok
    test_cat (cat.StringsCat.test_cat) ... ok
    <BLANKLINE>
    ----------------------------------------------------------------------
    Ran 4 tests in ...s
    <BLANKLINE>
    OK


======================================================================
FAIL: runTest (test_attribute_plugin.TestClassAndMethodAttrs.runTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jayvdb/python/nose3/functional_tests/test_attribute_plugin.py", line 23, in runTest
    self.verify()
  File "/home/jayvdb/python/nose3/functional_tests/test_attribute_plugin.py", line 153, in verify
    assert '(test_attr.TestClassAndMethodAttrs) ... ok' in self.output
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 
-------------------- >> begin captured stdout << ---------------------
**********************************************************************
test_method (test_attr.TestClassAndMethodAttrs.test_method) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.002s

OK

**********************************************************************

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: runTest (test_attribute_plugin.TestTopLevelNotSelected.runTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jayvdb/python/nose3/functional_tests/test_attribute_plugin.py", line 23, in runTest
    self.verify()
  File "/home/jayvdb/python/nose3/functional_tests/test_attribute_plugin.py", line 169, in verify
    assert 'test_a (test.TestBase) ... ok' in self.output
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 
-------------------- >> begin captured stdout << ---------------------
**********************************************************************
test_a (test.TestBase.test_a) ... ok
test.test_b ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.008s

OK

**********************************************************************

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: runTest (test_load_tests_from_test_case.TestLoadTestsFromTestCaseHook.runTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jayvdb/python/nose3/functional_tests/test_load_tests_from_test_case.py", line 53, in runTest
    self.assertEqual(line.strip(), expect.pop(0))
AssertionError: 'test_value (test_load_tests_from_test_case.Derived.test_value) ... ERROR' != 'test_value (test_load_tests_from_test_case.Derived) ... ERROR'
- test_value (test_load_tests_from_test_case.Derived.test_value) ... ERROR
?                                                   -----------
+ test_value (test_load_tests_from_test_case.Derived) ... ERROR

-------------------- >> begin captured stdout << ---------------------
options
configure
Called!
test_value (test_load_tests_from_test_case.Derived.test_value) ... ERROR
test_value (tests.Tests.test_value) ... ok

======================================================================
ERROR: test_value (test_load_tests_from_test_case.Derived.test_value)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jayvdb/python/nose3/functional_tests/support/ltftc/tests.py", line 9, in test_value
    self.assertEqual(self.value, 1)
                     ^^^^^^^^^^
AttributeError: 'Derived' object has no attribute 'value'

----------------------------------------------------------------------
Ran 2 tests in 0.006s

FAILED (errors=1)


--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: runTest (test_xunit.TestXUnitPlugin.runTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jayvdb/python/nose3/functional_tests/test_xunit.py", line 28, in runTest
    assert "test_skip (test_xunit_as_suite.TestForXunit) ... SKIP: skipit" in self.output
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 
-------------------- >> begin captured stdout << ---------------------
test-generated output
test_error (test_xunit_as_suite.TestForXunit.test_error) ... ERROR
test_fail (test_xunit_as_suite.TestForXunit.test_fail) ... FAIL
test_non_ascii_error (test_xunit_as_suite.TestForXunit.test_non_ascii_error) ... ERROR
test_output (test_xunit_as_suite.TestForXunit.test_output) ... ok
test_skip (test_xunit_as_suite.TestForXunit.test_skip) ... SKIP: skipit
test_success (test_xunit_as_suite.TestForXunit.test_success) ... ok

======================================================================
ERROR: test_error (test_xunit_as_suite.TestForXunit.test_error)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jayvdb/python/nose3/functional_tests/support/xunit/test_xunit_as_suite.py", line 15, in test_error
    raise TypeError("oops, wrong type")
TypeError: oops, wrong type

======================================================================
ERROR: test_non_ascii_error (test_xunit_as_suite.TestForXunit.test_non_ascii_error)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jayvdb/python/nose3/functional_tests/support/xunit/test_xunit_as_suite.py", line 18, in test_non_ascii_error
    raise Exception(u"日本")
Exception: 日本

======================================================================
FAIL: test_fail (test_xunit_as_suite.TestForXunit.test_fail)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jayvdb/python/nose3/functional_tests/support/xunit/test_xunit_as_suite.py", line 12, in test_fail
    self.assertEqual("this","that")
AssertionError: 'this' != 'that'
- this
+ that


----------------------------------------------------------------------
XML: /home/jayvdb/python/nose3/functional_tests/support/xunit.xml
----------------------------------------------------------------------
Ran 6 tests in 0.010s

FAILED (SKIP=1, errors=2, failures=1)


--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 406 tests in 15.153s

FAILED (SKIP=6, failures=7)

This was referenced Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants