Test & Code

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


Listen Later

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.



...more
View all episodesView all episodes
Download on the App Store

Test & CodeBy Brian Okken

  • 4.7
  • 4.7
  • 4.7
  • 4.7
  • 4.7

4.7

70 ratings


More shows like Test & Code

View all
Radiolab by WNYC Studios

Radiolab

44,013 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

624 Listeners

Heavy Networking by Packet Pushers

Heavy Networking

326 Listeners

Talk Python To Me by Michael Kennedy

Talk Python To Me

581 Listeners

Python Bytes by Michael Kennedy and Brian Okken

Python Bytes

213 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,109 Listeners

The Real Python Podcast by Real Python

The Real Python Podcast

140 Listeners

Unexplainable by Vox

Unexplainable

2,320 Listeners

Network Automation Nerds by Packet Pushers

Network Automation Nerds

5 Listeners