I posted this not because it’s earth shattering, but because it offers a bunch of helpful techniques actually written out in practice so folks struggling with coming up to speed with unit testing can benefit.
Good tips !
I ended up doing the same techniques at work and it works great.
On thing I do differently is that I tend to create a test file per class where each public method is tested in a dedicated test suite, like:
class TestRefresh(TestCase): def test_success(self): pass def test_fail_when_some_reason(self): pass
class TestRefresh(TestCase):
def test_success(self): pass
def test_fail_when_some_reason(self): pass
I have an irrational dislike of anything that smells like Java unittest so I always use Pytest :)
I posted this not because it’s earth shattering, but because it offers a bunch of helpful techniques actually written out in practice so folks struggling with coming up to speed with unit testing can benefit.
Good tips !
I ended up doing the same techniques at work and it works great.
On thing I do differently is that I tend to create a test file per class where each public method is tested in a dedicated test suite, like:
I have an irrational dislike of anything that smells like Java unittest so I always use Pytest :)