I have a question about how to correctly import module in python unit test module. this is my directory structure project - | _ Libra
How to mock a specific instance of a class using patch? In my test file I have: @classmethod def setUpClass(cls): cls.instance_of_my_class = myClass() one
In my Python project, I have a set of unittests, that load some data from files in a data sub-directory. In PyCharm (Community 2019.3), running each of them in
I have created a file containing environment variables and I am writing a test for this file. The file ("my_variables.py") looks like: import os if os.getenv("
I know similar questions have been asked before... But I had a quick doubt... I have been following this link: https://www.python-course.eu/python3_packages.php
I'm creating tests to check that a custom calibration model save function updates an asset record (foreign key) if it is the latest calibration record for the a
Rather than a long speech, if we run the minimum example below: $ python3 Python 3.7.6 (default, Jan 30 2020, 09:44:41) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
I'm trying to use py.test's fixtures with my unit tests, in conjunction with unittest. I've put several fixtures in a conftest.py file at the top level of the p
I'm interested in using unittest's subTest for looping through some very similar tests. I found that, when I run tests written in this way under pytest (or nos