What is the best alternative to pytest?
Here’s the Deal
Slant is powered by a community that helps you make informed decisions. Tell us what you’re passionate about to get your personalized feed and help others.
The way tests are run is through: if name == 'main': unittest.main() Then unittest.main() builds a TestSuite object that contains all the tests that have method names starting with "test", then a TextTestRunnerwhich then executes each method and prints the results. But individual test cases can be executed simply by specifying their names on the terminal: python unittest_program.py testProgram.testGetFeedPostingHost The default output is usually pretty concise, but it can be more verbose simply by adding a -v flag in the end when calling the test from the command line. So unittest can be considered pretty flexible when it comes to test case execution. See More