Python unittest runner and result generator in three different formats json, xml, html
Project description
python-unittest-cogent
A custom tests runner which gives output in three different formats (xml, json and html).
Quickstart
Installation:
pip install python-unittest-cogent
Usage: In example.py
import cogent
from cogent.tests import TestCase
class TestClassOne(TestCase):
def test1(self):
expected_number = 90
actual_number = 90
print('Test output foe test case 1')
self.assertEqual(expected_number, actual_number)
if __name__ == "__main__":
cogent.main()
To change the settings:
You can change the different-different settings like -
PROJECT_NAME = "Test Report"
APPLICATION_NAME = "Test APP"
APP_VERSION = "App Version 5.3"
PLATFORM = "Linux/Ubuntu 14.04"
HTML_TEST_REPORT_FILENAME = "Report.html"
XML_TEST_REPORT_FILENAME = "Report.xml"
JSON_TEST_REPORT_FILENAME = "Report.json"
DEFAULT_CONVERTER = "HTML"
In example.py
import cogent
from cogent.tests import TestCase
from cogent import settings
settings.DEFAULT_CONVERTER = "XML"
class TestClassOne(TestCase):
def test1(self):
expected_number = 90
actual_number = 90
print('Test output foe test case 1')
self.assertEqual(expected_number, actual_number)
if __name__ == "__main__":
cogent.main.settings = settings
cogent.main()
In case any queries you can contact me on my email - harshittrivedi78@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for python-unittest-cogent-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1083ddda4349d3134bd39a2361faae8e362f38e5b66ae870b3cbf88dd20d65d |
|
MD5 | e2dd48301cbba7febd14d0a67a0d7f66 |
|
BLAKE2b-256 | 6cee0b22fb4876fb3c6d8da9511569321e616cf37c159ad7d5c33116fef98e5f |
Close
Hashes for python_unittest_cogent-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03b5b9c80098ecf4a28746686e58e0d47546b3ad6eb65a80ae8c8820ff3353d1 |
|
MD5 | a183bcf54d401ea900d71dda6f9e9f34 |
|
BLAKE2b-256 | ed95dc3bddcfd7165c537fdc6d53ff1b6144c7925d32ee5ad497ba9559ddd094 |