Month: January 2018

Assertion rewriting in Pytest part 1: Why it’s needed

tim January 20, 2018 No Comments Internals

Pytest is fast becoming the de facto standard for Python unit testing. One of its most distinctive features is that it allows (indeed, encourages) you to use plain old Python assert rather than having to use library-specific assertSomeLongChainOfConditions methods. For example, instead of writing: def test_generate_list(self): results = generate_list() self.assertListContains(results, ‘foo’) You can write: def […]

Page 1 of 1