221: How to get pytest to import your code under test

We've got some code we want to test, and some tests.
The tests need to be able to import the code under test, or at least the API to it, in order to run tests against it.
How do we do that? How do we set things up so that our tests can import our code?

In this episode, we discuss two options:
  • Installing the code under test as a pip installable package with `pip install -e /path/to/local/package`.
  • Using the pythonpath pytest setting.

Sponsored by: 
  • The Complete pytest course is now a bundle, with each part available separately.
  • Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you.

★ Support this podcast on Patreon ★

Creators and Guests

Brian Okken
Host
Brian Okken
Software Engineer, also on Python Bytes and Python People podcasts
221: How to get pytest to import your code under test
Broadcast by