Skip to content

bpo-24780: unittest assertEqual difference output foiled by newlines - #11548

Closed
nanjekyejoannah wants to merge 3 commits into
python:masterfrom
nanjekyejoannah:issue24780
Closed

nanjekyejoannah wants to merge 3 commits into
python:masterfrom
nanjekyejoannah:issue24780

Conversation

@nanjekyejoannah

@nanjekyejoannah nanjekyejoannah commented Jan 14, 2019 •

Copy link
Copy Markdown
Contributor

I have created a fix for this issue and relevant tests.

https://bugs.python.org/issue24780

Comment thread Lib/unittest/case.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. line is a list here and this causes test failures due to TypeError. lines seems to be a better name since it makes me think it's a single line but it's actually a list of lines.

Comment thread Lib/unittest/test/test_case.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a better test would be to test the output diff like https://github.com/python/cpython/blob/e709c1be97a04156c628f534116a236b9581aa2f/Lib/unittest/test/test_case.py#L1122 and it should be testing the failure cases and asserting the Exception output string.

@nanjekyejoannah

Copy link
Copy Markdown
Contributor Author

@tirkarthi I made the necessary updates to this PR.

@tirkarthi

Copy link
Copy Markdown
Member

Thanks @nanjekyejoannah, tests should be fixed as noted in https://github.com/python/cpython/pull/11548/files#r247392463 . The tests are about the strings being equal and are not related to the issue. The actual tests should be about the diff output for the tests.

@nanjekyejoannah

Copy link
Copy Markdown
Contributor Author

closed this. Someone can open another PR.

@mblahay

mblahay commented Apr 26, 2023

Copy link
Copy Markdown
Contributor

@nanjekyejoannah Why did you close the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants