Skip to content
Global sound
Test & Code

Test & Code

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

· 8 min · Episode 221

Show notes

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.

Website: pythontest.com

Live, last hour: 8,777 songs on 4,888 stations in 124 countries

Discover the world through radio

More ways to discover (9)

Heard something good? Save it, or open it straight away in Spotify.

★ Artist of the week The fastest riser on the radio this week
Your song here? From € 9 per week →
Radio 538 luisteren - Live!Popular right now