Test & Code

Test & Code

Download on the App Store

Test & Code episodes

  • 11: pytest assert magic

    How pytest, unittest, and nose deal with assertions.

    The job of the test framework to tell developers how and why their tests failed is a difficult job.

    In this episode I talk about assert helper functions and the 3 methods pytest uses to get around having users need to use assert helper functions.

    Support Test & Code - Software Testing, Development, Python

    14 min
  • 10: Test Case Design using Given-When-Then from BDD

    Given-When-Then is borrowed from BDD and is my favorite structure for test case design.

    It doesn’t matter if you are using pytest, unittest, nose, or something completely different, this episode will help you write better tests.

    • The Given-When-Then structure for test method/function development.
    • How and why to utilize fixtures for your given or precondition code.
    • Similarities with other structure discriptions.
      • Setup-Test-Teardown
      • Setup-Excercise-Verify-Teardown.
      • Arrange-Act-Assert
      • Preconditions-Trigger-Postconditions.
      • Benefits
        • Communicate the purpose of your test more clearly
        • Focus your thinking while writing the test
        • Make test writing faster
        • Make it easier to re-use parts of your test
        • Highlight the assumptions you are making about the test preconditions
        • Highlight what outcomes you are expecting and testing against.
        • Links discussed in the show:

          • Mechanics of pytest, unittest, nose
          • unittest fixture reference
          • nose fixture reference
          • pytest fixtures (series of posts starting here)
          • pytest style fixtures
          • pytest parameterized fixtures
          • 21 min
          • 10: Test Case Design using Given-When-Then from BDD

            Given-When-Then is borrowed from BDD and is my favorite structure for test case design.

            It doesn’t matter if you are using pytest, unittest, nose, or something completely different, this episode will help you write better tests.

            • The Given-When-Then structure for test method/function development.
            • How and why to utilize fixtures for your given or precondition code.
            • Similarities with other structure discriptions.
              • Setup-Test-Teardown
              • Setup-Excercise-Verify-Teardown.
              • Arrange-Act-Assert
              • Preconditions-Trigger-Postconditions.
              • Benefits
                • Communicate the purpose of your test more clearly
                • Focus your thinking while writing the test
                • Make test writing faster
                • Make it easier to re-use parts of your test
                • Highlight the assumptions you are making about the test preconditions
                • Highlight what outcomes you are expecting and testing against.
                • Links discussed in the show:

                  • Mechanics of pytest, unittest, nose
                  • unittest fixture reference
                  • nose fixture reference
                  • pytest fixtures (series of posts starting here)
                  • pytest style fixtures
                  • pytest parameterized fixtures
                  • Support Test & Code - Software Testing, Development, Python

                    21 min
                  • 9: Harry Percival : Testing Web Apps with Python, Selenium, Django
                    • Intro to Harry Percival, his background and story of how he got into TDD and ended up writing a book
                    • Comparing using unittest and pytest with applicability to testing django projects. 
                    • Functional end to end testing with selenium.
                    • The django test client for middle level tests.
                    • test isolation
                    • django and isolated unit tests
                    • unit tests vs integration tests
                    • Testing done by the development team without an external QA
                    • Double loop TDD: Functional test first, then unit tests
                    • Spikes: investigations without tests
                    • Harry's experience with having a freely available web version of a book that is also intended to be sold.

                    Update: Comment from Harry Percival on 19-Jan-2014
                    I might have been a bit down on unit tests vs functional tests in that "unit tests never fail comment".

                    Not true at all, particularly as we've just been thru upgrading django on our core system, and the unit tests really saved our bacon on that one...

                    Links

                    • Test-Driven Development with Python
                    • Obey the Testing Goat - Harry's site dedicated to the book and related posts.
                    • Python Testing with unittest, nose, pytest
                    • Gary Bernhardt's talk, Boundaries talk including a discussion of "Functional Core, Imperative Shell".
                    • Video of Boundaries talk on youtube


                    46 min
                  • 9: Harry Percival : Testing Web Apps with Python, Selenium, Django
                    • Intro to Harry Percival, his background and story of how he got into TDD and ended up writing a book
                    • Comparing using unittest and pytest with applicability to testing django projects.
                    • Functional end to end testing with selenium.
                    • The django test client for middle level tests.

                    • test isolation

                    • django and isolated unit tests

                    • unit tests vs integration tests

                    • Testing done by the development team without an external QA

                    • Double loop TDD: Functional test first, then unit tests

                    • Spikes: investigations without tests

                    • Harry's experience with having a freely available web version of a book that is also intended to be sold.

                    • Update: Comment from Harry Percival on 19-Jan-2014

                      I might have been a bit down on unit tests vs functional tests in that "unit tests never fail comment".

                      Not true at all, particularly as we've just been thru upgrading django on our core system, and the unit tests really saved our bacon on that one...

                      Links
                      • Test-Driven Development with Python
                      • Obey the Testing Goat - Harry's site dedicated to the book and related posts.
                      • Python Testing with unittest, nose, pytest
                      • Gary Bernhardt's talk, Boundaries talk including a discussion of "Functional Core, Imperative Shell".
                      • Video of Boundaries talk on youtube
                      • Support Test & Code - Software Testing, Development, Python

                        46 min
                      • 6: Writing software is like nothing else

                        My experience with writing software comes from my experience: where I grew up, what eras I lived through, what my economical and geographical experiences have been, when I learned to code, and what projects I've worked on.

                        7 min

                      About Test & Code

                      From the publisher's feed

                      The Python Test Podcast hosted by Brian Okken

                      More shows like Test & Code

                      Radiolab by WNYC Studios

                      Radiolab

                      43,853 Listeners

                      Software Engineering Daily by Software Engineering Daily

                      Software Engineering Daily

                      623 Listeners

                      Heavy Networking by Packet Pushers

                      Heavy Networking

                      327 Listeners

                      Talk Python To Me by Michael Kennedy

                      Talk Python To Me

                      582 Listeners

                      Python Bytes by Michael Kennedy and Calvin Hendryx-Parker

                      Python Bytes

                      213 Listeners

                      Darknet Diaries by Jack Rhysider

                      Darknet Diaries

                      8,059 Listeners

                      The Real Python Podcast by Real Python

                      The Real Python Podcast

                      139 Listeners

                      Unexplainable by Vox

                      Unexplainable

                      2,313 Listeners

                      Network Automation Nerds by Packet Pushers

                      Network Automation Nerds

                      5 Listeners