AssertionError during Junit XML report generation in pytest #12670
Unanswered
mkjkec2005
asked this question in
Q&A
Replies: 1 comment
-
this looks like #12599 - unless more details are provided on what type of test item is used, we cant help |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
We are getting the following error during the Junit XML report generation. This error is observed when there is a test failure. For the pass scenario, the report is generated as expected. Could you please help in resolving this?
pytest 6.2.5
test.py 2024-07-30 10:39:16,340:[XYZ]:[PASS]:show ne : {Contains: ['ne-id']}
2024-07-30 10:39:16,695:[XYZ]:[FAIL]:show ne : {Contains: ['infinera']}
2024-07-30 10:39:16,695:[XYZ]:[FAIL]:Output=
protection
system-capabilities
topology
ne-function
system
services
facilities
equipment
ne
ne-id 'GXABCDEFGH66'
ne-name 'GX'
label ''
ne-type 'G30'
node-type ILA
mode-op standard
ne-vendor 'Infinera'
ne-site ''
ne-location ''
ne-sub-location ''
clli ''
node-controller-chassis-name '1'
altitude 0 meters
latitude 0.0000000000000000 degrees
longitude 0.0000000000000000 degrees
equipment-discovery-ready true
alarm-report-ready true
contact ''
oper-state enabled
avail-state 'partially-faulted abnormal in-service'
alarm-report-control allowed
[ ne ]
temproot@GX>
F
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in call
INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 182, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
INTERNALERROR> raise exc.with_traceback(exc.traceback)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in call
INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 182, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
INTERNALERROR> raise exc.with_traceback(exc.traceback)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/flaky/flaky_pytest_plugin.py", line 89, in pytest_runtest_protocol
INTERNALERROR> self.runner.pytest_runtest_protocol(item, nextitem)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/_pytest/runner.py", line 109, in pytest_runtest_protocol
INTERNALERROR> runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/_pytest/runner.py", line 126, in runtestprotocol
INTERNALERROR> reports.append(call_and_report(item, "call", log))
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/flaky/flaky_pytest_plugin.py", line 165, in call_and_report
INTERNALERROR> hook.pytest_runtest_logreport(report=report)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in call
INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR> raise exception.with_traceback(exception.traceback)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/_pytest/junitxml.py", line 589, in pytest_runtest_logreport
INTERNALERROR> reporter.append_failure(report)
INTERNALERROR> File "/usr/local/lib/python3.10/site-packages/_pytest/junitxml.py", line 201, in append_failure
INTERNALERROR> assert report.longrepr is not None
INTERNALERROR> AssertionError
=================================================== 1 failed in 3.87s ====================================================
Regards,
Mohan
Beta Was this translation helpful? Give feedback.
All reactions