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

Improve exception tests #477

Closed
2 tasks
behrtam opened this issue Jun 4, 2017 · 7 comments
Closed
2 tasks

Improve exception tests #477

behrtam opened this issue Jun 4, 2017 · 7 comments

Comments

@behrtam
Copy link
Contributor

behrtam commented Jun 4, 2017

Maybe we should change the way we test exceptions (see #476) to always use a context manger as this way is easier to understand.

def test_it(self):
    self.assertRaises(SomeException, do_something, 42, True)

def test_it_with_context(self):
    with self.assertRaises(SomeException):
        do_something(42, True)

Steps

  • update old tests
  • document this in the readme for new exercises
@cmccandless
Copy link
Contributor

I like the idea; it improves readability significantly.

Maybe we could take advantage of the Hacktoberfest momentum and create another wave of issues for this?

@ilya-khadykin
Copy link
Contributor

good idea, @cmccandless!
It would be somewhat hard to create a list of all affected exercises I think

@cmccandless
Copy link
Contributor

I can begin to make a list.

@ilya-khadykin
Copy link
Contributor

@cmccandless that would be awesome!

Once we have a list we can create separate issues for each exercise

@cmccandless
Copy link
Contributor

Affected exercises:

@cmccandless
Copy link
Contributor

As there is already a large amount of pull issues and pull requests designated for Hacktoberfest, I went ahead and created a single pull request for this (#945).

@ilya-khadykin
Copy link
Contributor

@cmccandless, wow, thanks a lot and sorry for the delay in review

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

No branches or pull requests

3 participants