FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix unit test with Python 3.15.0a3 · fedepell/robotframework@9ea9fa3 · GitHub

Repository navigation

Commit 9ea9fa3

Browse files
committed
Fix unit test with Python 3.15.0a3
With Python 3.15.0a3 10 unit tests fail with a similar output: ``` ====================================================================== FAIL: test_run_once (test_run_and_rebot.TestRun.test_run_once) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/python-robotframework-7.4-build/robotframework-7.4/utest/api/test_run_and_rebot.py", line 64, in test_run_once self._assert_outputs([("Pass And Fail", 2), (LOG, 1), ("Report:", 0)]) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/builddir/build/BUILD/python-robotframework-7.4-build/robotframework-7.4/utest/resources/runningtestcase.py", line 40, in _assert_outputs self._assert_output(sys.stderr, None) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ File "/builddir/build/BUILD/python-robotframework-7.4-build/robotframework-7.4/utest/resources/runningtestcase.py", line 48, in _assert_output self._assert_no_output(output) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ File "/builddir/build/BUILD/python-robotframework-7.4-build/robotframework-7.4/utest/resources/runningtestcase.py", line 52, in _assert_no_output raise AssertionError(f"Expected output to be empty:{output}") AssertionError: Expected output to be empty:/builddir/build/BUILD/python-robotframework-7.4-build/robotframework-7.4/utest/../src/robot/result/resultbuilder.py:147: ResourceWarning: unclosed iterparse iterator '/tmp/output.xml' self._parse(source, handler.start, handler.end) ``` This is due to warning raised with new Python versions for unclosed xml.etree.ElementTree.iterparse(), see also: python/cpython#140601 Fix this by explicitly closing the context before it goes out of scope.
1 parent 1cfe12d commit 9ea9fa3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎src/robot/result/resultbuilder.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def _parse(self, source, start, end):
166166
else:
167167
end(elem)
168168
elem.clear()
169+
context.close()
169170

170171
def _omit_keywords(self, context):
171172
omitted_elements = {"kw", "for", "while", "if", "try", "group", "variable"}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL