• Like
Testing for people who hate testing
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Testing for people who hate testing

  • 160 views
Published

SF Python Meetup lightning talk on unit testing with pytest.

SF Python Meetup lightning talk on unit testing with pytest.

Published in Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
160
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
1
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Testing for people who hate writing tests Tips and tricks for organizing and writing simple tests with pytest.
  • 2. Writing tests is painful ● ● ● ● what to test how to do it takes time QQ...
  • 3. Case study User facing ● Mobile API (Bono) ● Livelovely.com (Spot) ● Pro.livelovely.com (Pearl) ● Messaging API (Ditto) ● Photo API (Jiris)
  • 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. 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. Request fixture
  • 7. User fixture
  • 8. Test using fixture
  • 9. Interaction Fixture
  • 10. Test using fixture
  • 11. @linuxlewis -- @lovely http://livelovely.com sam@livelovely.com http://github.com/linuxlewis https://github.com/linuxlewis/sfpython-pytest