https://github.com/harshittrivedi78/python-unittest-cogent
Python unittest test runner and generate test output in html , json or xml.
https://github.com/harshittrivedi78/python-unittest-cogent
cogent custom custompythonunittest python-unittest python-unittest-testrunner testrunner unittest unittest-result-generator
Last synced: 5 months ago
JSON representation
Python unittest test runner and generate test output in html , json or xml.
- Host: GitHub
- URL: https://github.com/harshittrivedi78/python-unittest-cogent
- Owner: harshittrivedi78
- License: other
- Created: 2015-02-03T06:47:29.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-05-14T19:33:43.000Z (about 6 years ago)
- Last Synced: 2026-01-14T21:48:30.025Z (5 months ago)
- Topics: cogent, custom, custompythonunittest, python-unittest, python-unittest-testrunner, testrunner, unittest, unittest-result-generator
- Language: JavaScript
- Homepage:
- Size: 483 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## python-unittest-cogent
A custom tests runner which gives output in three different formats (xml, json and html).
### Quickstart
Installation:
```shell
pip install python-unittest-cogent
```
Usage: In example.py
```python
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 -
```python
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
```python
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