cutest.py-0.9.1
توضیحات
The colorful and beautiful terminal output of python unittest.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | cutest.py-0.9.1 |
| نام | cutest.py |
| نسخه کتابخانه | 0.9.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Lecnim |
| ایمیل نویسنده | lecnim@gmail.com |
| آدرس صفحه اصلی | https://github.com/lecnim/cutest.py |
| آدرس اینترنتی | https://pypi.org/project/cutest.py/ |
| مجوز | LICENSE |
.. figure:: https://github.com/lecnim/cutest.py/raw/master/images/example.png
:alt: Example terminal output
Simple test source file powered by docstrings:
.. code:: python
import cutest as unittest
class CoffeMachine(unittest.TestCase):
"""A good coffee machine"""
def test_success(self):
"""should makes hot drinks"""
class Dog(unittest.TestCase):
"""A typical dog"""
def test_barking(self):
"""should barks loudly"""
def test_tail(self):
"""has a tail"""
self.assertTrue(False)
class Cat(unittest.TestCase):
"""A typical cat"""
def test_meow(self):
"""can meow"""
print('an onomatopoeia for the voiced sound')
def test_fur(self):
"""has a fur"""
if __name__ == "__main__":
unittest.main()
Usage
-----
Import and use it just like ``unittest`` package:
.. code:: python
import cutest as unittest
Or run and it will auto-discover available tests:
.. code:: bash
$ python cutest.py
You can also test given file or package:
.. code:: bash
$ python cutest.py my_test.py
Standard minimalistic mode
--------------------------
.. code:: bash
$ python cutest.py
Output:
.. figure:: https://github.com/lecnim/cutest.py/raw/master/images/minimal_success.png
:alt: Minimalistic mode
Verbose mode
------------
.. code:: bash
$ python cutest.py -v
Output:
.. figure:: https://github.com/lecnim/cutest.py/raw/master/images/verbose_success.png
:alt: Verbose mode
نحوه نصب
نصب پکیج whl cutest.py-0.9.1:
pip install cutest.py-0.9.1.whl
نصب پکیج tar.gz cutest.py-0.9.1:
pip install cutest.py-0.9.1.tar.gz