-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpython3_test.sh
More file actions
40 lines (26 loc) · 1.46 KB
/
python3_test.sh
File metadata and controls
40 lines (26 loc) · 1.46 KB
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
37
38
39
40
#!/bin/bash
#---------------------- Setup --------------------------------------------------------------------------------
fail_color='\033[1;31m' #red
success_color='\033[1;32m' #green
primary_color='\033[1;4;37m' #Bold white underlined
secondary_color='\033[1;37m' #Bold white
prompt_color='\033[1;33m' #yellow
reset_color='\033[0m'
clear
test=$( ls | grep '^test_' | dmenu -p 'Please, Select a Test File:' )
#---------------------- Introduction -------------------------------------------------------------------------
echo -e ${primary_color}'Testing:'${reset_color}' "'${test}'"'
#---------------------- PEP8 Test ----------------------------------------------------------------------------
sleep 2
echo -e ${prompt_color}'\nPEP8 Testing ...\n'${reset_color}
pep8_issue_count=$(pep8 ${test} | wc -l )
echo -e 'Found on File '${test}'; '${fail_color}'"'${pep8_issue_count}'"'${reset_color}' PEP8 issues!'
#---------------------- Unit Test ----------------------------------------------------------------------------
#sleep 2
#time python3 -m unittest ${test}
#---------------------- Pytest -------------------------------------------------------------------------------
sleep 2
echo -e ${prompt_color}'\nPytesting ...\n'${reset_color}
time python3 -m pytest -v ${test}
#---------------------- Conclusion ---------------------------------------------------------------------------
echo -e ${success_color}'\nDone!\n' ${reset_color}