Testing for people who hate testing

316
-1

Published on

SF Python Meetup lightning talk on unit testing with pytest.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
316
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

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) ● Livelovely.com (Spot) ● Pro.livelovely.com (Pearl) ● Messaging API (Ditto) ● Photo API (Jiris)
  4. 4. Organizing ● mimic application structure ○ easy to remember ○ helps scope tests ○ easy test hooks ● pytest discovery ○ http://pytest.org/latest/goodpractises. 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 http://livelovely.com sam@livelovely.com http://github.com/linuxlewis https://github.com/linuxlewis/sfpython-pytest
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×