Skip to content

Improve exception tests #477

Closed
Closed
@behrtam

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions