O'Reilly logo

Python Testing Cookbook by Greg L. Turnquist

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Leaving out integration tests

A fast test suite avoids connecting to remote systems, like databases, LDAP, etc. Just verifying the core units and avoiding external systems can result in a faster running test suite with more coverage. This can lead to a useful smoke test that provides developers with confidence in the system without running all the tests.

How to do it...

With these steps, we will see how to cut out test cases that interact with external systems.

  1. Create a test module called recipe60_test.py for writing some tests against our network application.
    import logging
    from network import *
    import unittest
    from springpython.database.factory import *
    from springpython.database.core import *
  2. Create a test case that removes the database connection ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required