Skip to content

bpo-46442: improve testExceptionCleanupNames#30753

Closed
yellowdusk1590 wants to merge 0 commit intopython:mainfrom
yellowdusk1590:main
Closed

bpo-46442: improve testExceptionCleanupNames#30753
yellowdusk1590 wants to merge 0 commit intopython:mainfrom
yellowdusk1590:main

Conversation

@yellowdusk1590
Copy link
Contributor

@yellowdusk1590 yellowdusk1590 commented Jan 21, 2022

The test tested that explicitly deleting the local variable bound to the exception
did not cause problems, but it did not test what it actually claimed to test, i.e.
that the variable is deleted automatically.

https://bugs.python.org/issue46442

@bedevere-bot bedevere-bot added the tests Tests in the Lib/test dir label Jan 21, 2022
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@yellowdusk1590

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Copy link
Member

Choose a reason for hiding this comment

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

While you're here, could you rename this to test_exception_cleanup_names (and any other tests you see with camel case names?)

(Make sure test names are unique after your change.)

Copy link
Member

Choose a reason for hiding this comment

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

I think renaming (except for possibly this one test) should happen in a different commit.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Congrats on your first PR to CPython 🎉

Make sure to sign our CLA.
Feel free to ping me if you need help.

Copy link
Member

@sobolevn sobolevn Jan 21, 2022

Choose a reason for hiding this comment

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

I would say that self.assertIsInstance(e, Exception) makes a bit more sense here 🤔

But, I think it is ok to keep this in sync with the second part.

Copy link
Member

Choose a reason for hiding this comment

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

Could change both to self.assertIsNotNone(e)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I just copy-pasted the existing code. I don't think it really matters what it does there, just e would be just as fine, because I am sure there are other tests which test that the caught exception is indeed an exception :)

@yellowdusk1590
Copy link
Contributor Author

I have no idea what I've done, tried to rebase and ended up messing everything up. I'll open a new PR.

@iritkatriel
Copy link
Member

I have no idea what I've done, tried to rebase and ended up messing everything up. I'll open a new PR.

Ok, leave out the test name changing commit - there is no consensus on that.

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

Labels

awaiting review skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants