221: How to get pytest to import your code under test
Listen now
Description
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 Mailtrap.io An Email Delivery Platform that developers love. An email-sending solution with industry-best analytics, SMTP, and email API, SDKs for major programming languages, and 24/7 human support. Try for Free at MAILTRAP.IOSponsored by The Complete pytest Course For the fastest way to learn pytest, go to courses.pythontest.comWhether your new to testing or pytest, or just want to maximize your efficiency and effectiveness when testing.
More Episodes
Published 06/03/24
PyCon US is just around the corner.  I've asked Rob Ludwick to come on the show to discuss how to get the most out of your PyCon experience. There's a lot to do. A lot of activities to juggle, including actual juggling, which is where we start the conversation. Even if you never get a chance to...
Published 05/04/24
I'm starting a SaaS project using Django, and there are tons of decisions right out of the gate. To help me navigate these decisions, I've brought on Cory Zue.   Cory is the creator of SaaS Pegasus, and has tons of experience with Django. Some of the topics discussed: Building Django...
Published 04/24/24