-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_suite
executable file
·51 lines (51 loc) · 950 Bytes
/
test_suite
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
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
pytest test_random_verse.py --cov=./
PYTEST_EXIT_STATUS=$?
coverage run random_verse.py
TEST_EXIT_STATUS=$?
python3 --version
if ! [ $? -eq 127 ]
then
python3 -m flake8 random_verse.py test_random_verse.py
else
flake8 random_verse.py test_random_verse.py
fi
FLAKE8_EXIT_STATUS=$?
pydocstyle random_verse.py
PYDOC_EXIT_STATUS=$?
black --check .
BLACK_EXIT_STATUS=$?
echo "======Summary====="
if [ $PYTEST_EXIT_STATUS -eq 0 ] && [ $TEST_EXIT_STATUS -eq 0 ]
then
tput setaf 2
echo "Tests passed"
else
tput setaf 1
echo "Tests failed"
fi
if [ $FLAKE8_EXIT_STATUS -eq 0 ]
then
tput setaf 2
echo "Flake8 likes it"
else
tput setaf 1
echo "Flake8 complains"
fi
if [ $PYDOC_EXIT_STATUS -eq 0 ]
then
tput setaf 2
echo "PEP 257 likes it"
else
tput setaf 1
echo "PEP 257 complains"
fi
if [ $BLACK_EXIT_STATUS -eq 0 ]
then
tput setaf 2
echo "Black likes it"
else
tput setaf 1
echo "Black complains"
fi
tput setaf 9