-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_test.py
36 lines (24 loc) · 1.2 KB
/
run_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# run_test.py
#------------------------------------------------------------------------------------------------
####################################
### Import the necessary modules ###
####################################
import os
import webbrowser
#------------------------------------------------------------------------------------------------
#------------------------------------------------------------------------------------------------
######################
### Running Tests ###
######################
if __name__ == "__main__":
# Command to run tests with coverage and generate HTML report
command = "nosetests --with-coverage --cover-erase --cover-html --cover-package=project"
# Execute the command to run tests with coverage and generate HTML report
os.system(command)
command = "pip freeze"
os.system(command)
# Path to the generated coverage HTML report
cover_report_path = "file:///C:/Users/cumon/Desktop/Web%20Projects/flask-skeleton/cover/index.html"
# Open the coverage report in the default web browser
webbrowser.open(cover_report_path)
#------------------------------------------------------------------------------------------------