Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reveal previously hidden AttributeErrors and TypeErrors#3668

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lovelydinosaur merged 1 commit intoencode:masterfromakx:exc-hiding
Nov 27, 2015

Conversation

@akx
Copy link
Contributor

@akxakx commentedNov 24, 2015

This ensures AttributeErrors and TypeErrors do not get hidden when DRF is just looking for aget_queryset().

@lovelydinosaur
Copy link
Contributor

Prob worth issuing as two separate PRs.
Theget_queryset ones are simple enough and would prob accept those as-is.
The.count() I'd want to give more review to.

@akx
Copy link
ContributorAuthor

akx commentedNov 25, 2015

Sure, I'll snip that one out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressing any windows test failures should probably be treated as a separate PR.
I assume that's what this change is about, right?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yeah -- though it's a bit odd thatrepr would act differently across platforms...

@akx
Copy link
ContributorAuthor

akx commentedNov 26, 2015

I'll split the test stuff into yet another PR. :)

@akxakxforce-pushed theexc-hiding branch 2 times, most recently from93e344f to447ad2aCompareNovember 26, 2015 13:25
@akxakx mentioned this pull requestNov 26, 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a regular AttributeError would be okay here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or perhapsreturn self.this_attribute_does_not_exist?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I subclassedAttributeError for the test for the purpose of being able to check for that exact exception being propagated up, which was the point of the patch in the first place :)

@lovelydinosaur
Copy link
Contributor

Okay, on review at this point I'd actually rather have this, butwithout the test cases.
It's a case of evidently improved behavior, and I think they'd actually add more noise than value in this case. Otherwise fix looks good, so happy to move once tests have been dropped. 👍

@akx
Copy link
ContributorAuthor

akx commentedNov 27, 2015

Well, if you're sure! I'll take the test cases out.

Quietly catching `AttributeError` and `TypeError` when calling`get_queryset()` is rather insidious, as those exceptions get caught nomatter where they might happen in the call stack.
@akx
Copy link
ContributorAuthor

akx commentedNov 27, 2015

Tests are now gone,@tomchristie.

@lovelydinosaur
Copy link
Contributor

May seem counter-intuitive, but they come with an associated cost, and can be okay not to strictly test against obviously better/cleaner behavior.

lovelydinosaur added a commit that referenced this pull requestNov 27, 2015
Reveal previously hidden AttributeErrors and TypeErrors
@lovelydinosaurlovelydinosaur merged commit0d0aff4 intoencode:masterNov 27, 2015
@akxakx deleted the exc-hiding branchNovember 27, 2015 14:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

3.3.2 Release

Development

Successfully merging this pull request may close these issues.

2 participants

@akx@lovelydinosaur

[8]ページ先頭

©2009-2025 Movatter.jp