Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Testing for people who hate testing


Published on

SF Python Meetup lightning talk on unit testing with pytest.

Published in: Technology, Business
  • Be the first to comment

Testing for people who hate testing

  1. 1. Testing for people who hate writing tests Tips and tricks for organizing and writing simple tests with pytest.
  2. 2. Writing tests is painful ● ● ● ● what to test how to do it takes time QQ...
  3. 3. Case study User facing ● Mobile API (Bono) ● (Spot) ● (Pearl) ● Messaging API (Ditto) ● Photo API (Jiris)
  4. 4. Organizing ● mimic application structure ○ easy to remember ○ helps scope tests ○ easy test hooks ● pytest discovery ○ html#conventions-for-python-test-discovery
  5. 5. Theres a fixture for that... ● test fixture is a fixed state of the software under test used as a baseline for running tests; also known as the test context. ● reusable bits of code that are used to write tests. ● fixtures replace traditional setup/teardown ● fixtures can be built on top of each other
  6. 6. Request fixture
  7. 7. User fixture
  8. 8. Test using fixture
  9. 9. Interaction Fixture
  10. 10. Test using fixture
  11. 11. @linuxlewis -- @lovely