Detect missing unittests
I am refactoring a legacy Python project, which did not have any unittests.
Assuming a directory structure like this:
I am refactoring a legacy Python project, which did not have any unittests.
Assuming a directory structure like this:
Trying to figure out how to overwrite a variable during unit testing:
I have a directory that contains my Python unit tests. Each unit test module is of the form test_*.py. I am attempting to make a file called all_test.py that will, you guessed it, run all files in the aforementioned test form and return the result. I have tried two methods so far; both have failed. I will show the two methods, and I hope someone out there knows how to actually do this correctly.
In our team, we define most test cases like this:
I’m working on a python (2.7) program that produce a lot of different matplotlib figure (the data are not random). I’m willing to implement some test (using unittest) to be sure that the generated figures are correct. For instance, I store the expected figure (data or image) in some place, I run my function and compare the result with the reference. Is there a way to do this ?