-
Notifications
You must be signed in to change notification settings - Fork 24
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
AttributeError: 'ExceptionChainRepr' object has no attribute 'replace' #55
Comments
I have re-created the error in a test case.
|
Understanding this issue. On these lines, a FailureType is initialized. pytest-nunit/pytest_nunit/nunit.py Lines 173 to 176 in 3833c56
The result from case["error"] is expected to be a string value that gets assigned to the text attribute on the CDataComment object. pytest-nunit/pytest_nunit/attrs2xml.py Lines 6 to 9 in 3833c56
This testcase instead of returning a string, returns an instance of the object ExceptionChainRepr. Compare this output from the test_fail testcase with the output from the test_fixture_error testcase. test_fail testcase
test_fixture_error testcase
One potential solution, is to coerce the ReprObject into a string by str(case["error"]). That would set the 'error' value to this.
The only concern I have is whether all the other case values for this testcase are captured correctly. |
I think it should do the following:
|
Ok, looked into it some more.
|
MacOS 12.4
Python 3.9.12 (system Python)
pytest 7.1.2
pytest-nunit 1.0.0
When executing code with a failing fixture, and a test with 'xfail' mark:
I'm getting an exception:
AttributeError: 'ExceptionChainRepr' object has no attribute 'replace'
nunit_exception.log
But only when executing with '--nunit-xml' option
The text was updated successfully, but these errors were encountered: