-
Couldn't load subscription status.
- Fork 126
Closed
Labels
Milestone
Description
We switched to pytest in #939, which means we don't have to use unittest.TestCase anymore; we can switch to free functions. In most cases, converting tests should be as simple as changing:
class MyTestCase(unittest.TestCase):
def test_foo(self) -> None:
self.assertTrue(True)to
def test_foo() -> None:
assert TrueWhile this is a little bike-sheddy, this does have some benefits:
- Enable fixtures, parameterization, and custom hooks
- Reduces confusion for new contributors, who might be unsure of which test format to use
- Reduces the indentation level (a little thing, I know, but IMO it reads cleaner to have less leading whitespace)