classification
Title: test_xml_etree and test_xml_etree_c fail due to AssertionError: unhandled warning DeprecationWarning
Type: Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Arfrever, eli.bendersky, ezio.melotti, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-04-09 19:36 by Arfrever, last changed 2017-04-12 13:01 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1065 merged serhiy.storchaka, 2017-04-09 20:09
Messages (4)
msg291392 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2017-04-09 19:36
test_xml_etree.py and test_xml_etree_c.py on 2.7 branch fail since this commit:

commit 68903b656d4e1011525a46cbd1338c6cbab83d6d
Author: Serhiy Storchaka <storchaka@gmail.com>
Date:   Sun Apr 2 16:55:43 2017 +0300

    bpo-15083: Convert ElementTree doctests to unittests. (#906)


Output of test suite:

[388/399] test_xdrlib
[389/399] test_xml_etree
/tmp/cpython/Lib/test/test_xml_etree.py:1674: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x
  class MutatingElementPath(str):
/tmp/cpython/Lib/test/test_xml_etree.py:1684: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x
  class BadElementPath(str):
test test_xml_etree crashed -- <type 'exceptions.AssertionError'>: unhandled warning DeprecationWarning('Overriding __eq__ blocks inheritance of __hash__ in 3.x',)
[390/399/1] test_xml_etree_c
test test_xml_etree_c crashed -- <type 'exceptions.AssertionError'>: unhandled warning DeprecationWarning('classic int division',)
[391/399/2] test_xmllib
...
360 tests OK.
2 tests failed:
    test_xml_etree test_xml_etree_c
Re-running failed tests in verbose mode
Re-running test 'test_xml_etree' in verbose mode
/tmp/cpython/Lib/test/test_xml_etree.py:1674: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x
  class MutatingElementPath(str):
/tmp/cpython/Lib/test/test_xml_etree.py:1684: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x
  class BadElementPath(str):
...
Ran 117 tests in 0.934s

OK
test test_xml_etree crashed -- <type 'exceptions.AssertionError'>: unhandled warning DeprecationWarning('Overriding __eq__ blocks inheritance of __hash__ in 3.x',)
Traceback (most recent call last):
  File "./Lib/test/regrtest.py", line 989, in runtest_inner
  File "/tmp/cpython/Lib/test/test_xml_etree.py", line 2671, in test_main
    support.run_unittest(*test_classes)
  File "/tmp/cpython/Lib/test/test_xml_etree.py", line 2630, in __exit__
    self.checkwarnings.__exit__(*args)
  File "/tmp/cpython/Lib/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/tmp/cpython/Lib/test/test_support.py", line 905, in _filterwarnings
    raise AssertionError("unhandled warning %r" % reraise[0])
AssertionError: unhandled warning DeprecationWarning('Overriding __eq__ blocks inheritance of __hash__ in 3.x',)
Re-running test 'test_xml_etree_c' in verbose mode
...
Ran 118 tests in 0.112s

OK (skipped=19)
test test_xml_etree_c crashed -- <type 'exceptions.AssertionError'>: unhandled warning DeprecationWarning('classic int division',)
Traceback (most recent call last):
  File "./Lib/test/regrtest.py", line 989, in runtest_inner
  File "/tmp/cpython/Lib/test/test_xml_etree_c.py", line 64, in test_main
    test_xml_etree.test_main(module=cET)
  File "/tmp/cpython/Lib/test/test_xml_etree.py", line 2671, in test_main
    support.run_unittest(*test_classes)
  File "/tmp/cpython/Lib/test/test_xml_etree.py", line 2630, in __exit__
    self.checkwarnings.__exit__(*args)
  File "/tmp/cpython/Lib/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/tmp/cpython/Lib/test/test_support.py", line 905, in _filterwarnings
    raise AssertionError("unhandled warning %r" % reraise[0])
AssertionError: unhandled warning DeprecationWarning('classic int division',)
2 tests failed again:
    test_xml_etree test_xml_etree_c
msg291394 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-04-09 19:45
Ah, I ran tests with -Wa and -We, but forgot to run with -3. Thank you for noticing this Arfrever!
msg291395 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2017-04-09 19:45
To reproduce problem when running only these 2 files, use e.g.:
python2.7 -3 -m test.test_xml_etree
python2.7 -3 -m test.test_xml_etree_c

For full test suite, this -3 option is set in Makefile:
TESTPYTHON=     $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
msg291549 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-04-12 13:00
New changeset 65c5b096ac2c6608d296f1603cd4792086108c95 by Serhiy Storchaka in branch '2.7':
bpo-30027: Fix Py3k warnings in test_xml_etree. (#1065)
https://github.com/python/cpython/commit/65c5b096ac2c6608d296f1603cd4792086108c95
History
Date User Action Args
2017-04-12 13:01:33serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: resolved
2017-04-12 13:00:16serhiy.storchakasetmessages: + msg291549
2017-04-09 20:09:28serhiy.storchakasetpull_requests: + pull_request1211
2017-04-09 19:45:52Arfreversetmessages: + msg291395
2017-04-09 19:45:47serhiy.storchakasetmessages: + msg291394
2017-04-09 19:36:58Arfrevercreate