I am a beginner in test technology. This post is also written by repeating trial and error. Therefore, (although I'm careful) what is written in this post is not always correct. Also, if you notice a mistake or make a new discovery, we will update it from time to time.
In this article, I would like to touch on pytest, a testing tool for python. Specifically, I would like to introduce an overview (but copy and paste) of pytest and sample code. Other test tools for python include unittest, nose, and doctest. These will be introduced in another article.
What is pytest? Python 2.6-3.4, PyPy and Jython-2.5.1 running on windows It is a test tool for. The difference from other test tools is
A big feature of this pytest is that you can easily parameterize the values used in the test methods. by [Algebra written in Python --pytest](http://blog.elliptium.net/2012/05/Python --- pytest)
Tomo
The only assertion to use is assert. You don't have to memorize the assert method endlessly. This simplicity is wonderful. by [How to get started with py.test](http://blog.craftgear.net/549a26cc5d7d17f472000002/title/py.test%E3%81%AE%E3%81%AF%E3%81%98%E3%82 % 81% E3% 81% 8B% E3% 81% 9F)
Tomo
It seems that you can run tests that integrate nose, unittest.py, and doctest.py, and you can run flexible tests with various options. Of course, you can also get coverage. by Python, Django area unit test situation (unittest / nose / django-nose)
Tomo
Assert is easy to use, has strong fixture and state management support, and works with a debugger. by Summary of unit test tools for Python
It's also said, but I'm a beginner, so I'm not sure. Will it become clear as you use it in various ways?
Anyway, I don't know anything unless I start, so let's install it for the time being. How to install
pip install -U pytest # or easy_install -U pytest by Installation and Getting Started is.
If you do not have pip installed, please refer to here.
Recommended Posts