Python testing with pytest: motivation, demonstration, and practices
Testing software ensures that simulation or application software remains functional throughout development, and proves that software operates a specific way when deployed or frozen. In software engineering, testing is a necessary practice for reliable software. This talk motivates the use of pytest to test Python code by outlining common requirements for a testing framework, and demonstrates the use of pytest.
One common requirement from a testing framework is that a developer must be able to test aspects of their software under many conditions without duplicating code, using test parameterisation. Another requirement is the need to test certain areas of code in isolation to more easily identify the cause of problems; this can be achieved by mocking areas that are tested elsewhere. Testing all code in every possible condition is ideal, but time must be budgeted to run the most essential tests. This limitation motivates the design of a fast-running test suite; this talk demonstrates running tests in parallel and across machines. After a summary, this talk concludes with a brief mention of other useful testing tools.
6pm–7.30pm, 29th November 2017
Southampton University, Highfield Campus, Building 6 (Nuffield Theatre), Room 1081 (map)