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)
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?
good idea, @cmccandless! It would be somewhat hard to create a list of all affected exercises I think
I can begin to make a list.
@cmccandless that would be awesome!
Once we have a list we can create separate issues for each exercise
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).
@cmccandless, wow, thanks a lot and sorry for the delay in review
Improve exception tests by making use of Context Managers to resolve #…
bowling: use context manager form for assertRaises (RE: #477)
Activity
cmccandless commented on Oct 5, 2017
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 commented on Oct 5, 2017
good idea, @cmccandless!
It would be somewhat hard to create a list of all affected exercises I think
cmccandless commented on Oct 5, 2017
I can begin to make a list.
ilya-khadykin commented on Oct 5, 2017
@cmccandless that would be awesome!
Once we have a list we can create separate issues for each exercise
cmccandless commented on Oct 5, 2017
Affected exercises:
cmccandless commented on Oct 17, 2017
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 commented on Oct 17, 2017
@cmccandless, wow, thanks a lot and sorry for the delay in review
Improve exception tests by making use of Context Managers to resolve #…
bowling: use context manager form for assertRaises (RE: #477)