Closed musicinmybrain closed 5 months ago
@musicinmybrain any chance you can add a print(error_lines)
before the assert and paste it here? Thanks!
@musicinmybrain any chance you can add a
print(error_lines)
before the assert and paste it here? Thanks!
Thanks for the suggestion. That gives much more useful output:
--------------------------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------------------------
['Unexpected exception was raised:', ' File "/home/ben/src/forks/opentelemetry-python/tests/opentelemetry-test-utils/tests/test_utils.py", line 74, in test_missing_exception', ' raise_zero_division_error()', ' ~~~~~~~~~~~~~~~~~~~~~~~~~^^', '', ' File "/home/ben/src/forks/opentelemetry-python/tests/opentelemetry-test-utils/tests/test_utils.py", line 72, in raise_zero_division_error', ' raise ZeroDivisionError()', '']
Compare to this for Python 3.12:
['Unexpected exception was raised:', ' File "/home/ben/src/forks/opentelemetry-python/tests/opentelemetry-test-utils/tests/test_utils.py", line 74, in test_missing_exception', ' raise_zero_division_error()', '', ' File "/home/ben/src/forks/opentelemetry-python/tests/opentelemetry-test-utils/tests/test_utils.py", line 72, in raise_zero_division_error', ' raise ZeroDivisionError()', '']
So Python 3.13 has improved the error messages by adding a line
~~~~~~~~~~~~~~~~~~~~~~~~~^^
to indicate a particular column of the source line, but this breaks the test assumptions.
What do you think of #3961?
What do you think of #3961?
LGTM, thanks
Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.
Python 3.13.0b1 as packaged in Fedora 40,
x86_64
.Steps to reproduce
Describe exactly how to reproduce the error. Include a code sample if applicable.
What is the expected behavior?
All tests pass, as they do for Python 3.12:
What is the actual behavior?
Additional context
This was reported downstream in https://bugzilla.redhat.com/show_bug.cgi?id=2290563.