Skip to content
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

Preserve stack traces in Python 2.7 #10

Merged
merged 1 commit into from
Nov 3, 2016

Conversation

jcushman
Copy link
Contributor

(This is written against PetrDlouhy's open pull request #8, so I'll have to rebase once that goes in -- sending pull req now to avoid losing track of it.)

The actual change here is tests.py line 29-38, which adds special handling for re-raising errors under Python 2.7.

six.raise_from just throws away the original exception under Python 2. So you end up with an exception like: ModelAdminCheckException: Above exception occured while running test 'test_queryset', but there is no exception above, making the problem impossible to debug.

This pull req makes sure the original error message and stack trace are visible on Python 2, by appending the original exception's error message to the ModelAdminCheckException message, and re-raising the original exception's stack trace.

@coveralls
Copy link

coveralls commented Sep 12, 2016

Coverage Status

Coverage increased (+6.9%) to 96.599% when pulling eae2e91 on jcushman:py2-error into 53ecdfa on greyside:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+6.9%) to 96.599% when pulling eae2e91 on jcushman:py2-error into 53ecdfa on greyside:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+6.9%) to 96.599% when pulling eae2e91 on jcushman:py2-error into 53ecdfa on greyside:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+6.9%) to 96.599% when pulling eae2e91 on jcushman:py2-error into 53ecdfa on greyside:master.

@SeanHayes
Copy link
Member

#8 has been squashed and merged, you can rebase now.

@coveralls
Copy link

coveralls commented Nov 3, 2016

Coverage Status

Coverage decreased (-1.8%) to 95.758% when pulling 0d0795f on jcushman:py2-error into 746382c on greyside:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.8%) to 95.758% when pulling 0d0795f on jcushman:py2-error into 746382c on greyside:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.8%) to 95.758% when pulling 0d0795f on jcushman:py2-error into 746382c on greyside:master.

@coveralls
Copy link

coveralls commented Nov 3, 2016

Coverage Status

Coverage increased (+0.04%) to 97.576% when pulling 15d43bb on jcushman:py2-error into 746382c on greyside:master.

@coveralls
Copy link

coveralls commented Nov 3, 2016

Coverage Status

Coverage increased (+0.04%) to 97.576% when pulling 22d4f65 on jcushman:py2-error into 746382c on greyside:master.

@coveralls
Copy link

coveralls commented Nov 3, 2016

Coverage Status

Coverage increased (+0.04%) to 97.576% when pulling 7dba371 on jcushman:py2-error into 746382c on greyside:master.

@jcushman
Copy link
Contributor Author

jcushman commented Nov 3, 2016

OK, rebased. Took a few passes to get all the tests happy.

@SeanHayes SeanHayes merged commit 3c43475 into greyside:master Nov 3, 2016
@SeanHayes
Copy link
Member

Thanks for the quick response!

PetrDlouhy pushed a commit to PetrDlouhy/django-admin-smoke-tests that referenced this pull request Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants