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

Fix test_exception_branch_exists #287

Merged

Conversation

a3626a
Copy link
Contributor

@a3626a a3626a commented Jan 4, 2023

Recently, I have ported a portion of nbgitpuller into Ruby On Rails compatible ruby version. Meanwhile, I have found that 'test_exception_branch_exists' doesn't test anything. Actually puller.gp.branch_exists("wrong") was not throwing any errors, and assert type(e) == ValueError was not called at all.

I refered test_exception_resolve_default_branch and test_git_lock, and introduced exception_raised variable and puller.gp.git_url = "" assignment.

@welcome
Copy link

welcome bot commented Jan 4, 2023

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@yuvipanda
Copy link
Contributor

Ah, thanks for looking into this!

Can you rework this to use https://docs.pytest.org/en/7.1.x/how-to/assert.html#assertions-about-expected-exceptions instead? That's the expected way to test for expected exceptions in pytest I think.

@a3626a
Copy link
Contributor Author

a3626a commented Jan 5, 2023

Ah, thanks for looking into this!

Can you rework this to use https://docs.pytest.org/en/7.1.x/how-to/assert.html#assertions-about-expected-exceptions instead? That's the expected way to test for expected exceptions in pytest I think.

Of course, that is great. It is done.

@yuvipanda
Copy link
Contributor

Thanks @a3626a. Looks like the test failures may be related?

@a3626a
Copy link
Contributor Author

a3626a commented Jan 5, 2023

@yuvipanda

Thanks @a3626a. Looks like the test failures may be related?

It is really done!

@minrk minrk merged commit 98590e9 into jupyterhub:main Apr 11, 2023
@welcome
Copy link

welcome bot commented Apr 11, 2023

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

@a3626a a3626a deleted the fix/test-exception-branch-exists branch April 11, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants