Pergi ke luar talian dengan aplikasi Player FM !
221: How to get pytest to import your code under test
Manage episode 421789002 series 2508404
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.
Learn pytest
- pytest is the number one test framework for Python.
- Learn the basics super fast with Hello, pytest!
- Then later you can become a pytest expert with The Complete pytest Course
- Both courses are at courses.pythontest.com
222 episod
Manage episode 421789002 series 2508404
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.
Learn pytest
- pytest is the number one test framework for Python.
- Learn the basics super fast with Hello, pytest!
- Then later you can become a pytest expert with The Complete pytest Course
- Both courses are at courses.pythontest.com
222 episod
Semua episod
×Selamat datang ke Player FM
Player FM mengimbas laman-laman web bagi podcast berkualiti tinggi untuk anda nikmati sekarang. Ia merupakan aplikasi podcast terbaik dan berfungsi untuk Android, iPhone, dan web. Daftar untuk melaraskan langganan merentasi peranti.