Skip to content

Commit 48cb0d5

Browse files
authored
Testing and quality upgrades (#123)
* Change to pytest, pycodestyle, upgrade quality * Add isort and tweak quality / coverage settings * Fix quality issues, upgrade edx-lint, remove unused lint disables
1 parent 38a5396 commit 48cb0d5

35 files changed

+604
-385
lines changed

.coveragerc

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[run]
22
branch = True
33
source = .
4+
omit =
5+
workbench/test/*
6+
sample_xblocks/*/test/*

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ local_settings.py
55
*.egg-info
66
.treerc
77
.coverage
8+
.idea
89
.tox
10+
.pytest_cache
911
htmlcov
1012
geckodriver.log
1113

.isort.cfg

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[settings]
2+
line_length = 120
3+
skip = migrations
4+
known_edx =
5+
known_django = django
6+
known_first_party =
7+
workbench
8+
sample_xblocks
9+
sections = FUTURE,STDLIB,THIRDPARTY,DJANGO,DJANGOAPP,EDX,FIRSTPARTY,LOCALFOLDER

.pep8

-2
This file was deleted.

.travis.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ python:
1010

1111
env:
1212
- TOXENV=py27-django18
13-
- TOXENV=py27-django110
1413
- TOXENV=py27-django111
1514

1615
matrix:
@@ -26,23 +25,23 @@ cache:
2625
- $HOME/.cache/pip
2726

2827
before_script:
29-
- "export DISPLAY=:99.0"
30-
- "sh -e /etc/init.d/xvfb start"
31-
- "sleep 3" # give xvfb some time to start
28+
- export DISPLAY=:99.0
29+
- sh -e /etc/init.d/xvfb start
30+
- sleep 3 # give xvfb some time to start
3231

3332
before_install:
34-
- "wget https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz"
35-
- "mkdir geckodriver"
36-
- "tar -xzf geckodriver-v0.15.0-linux64.tar.gz -C geckodriver"
37-
- "export PATH=$PATH:$PWD/geckodriver"
38-
- "pip install -U pip"
33+
- wget https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz
34+
- mkdir geckodriver
35+
- tar -xzf geckodriver-v0.15.0-linux64.tar.gz -C geckodriver
36+
- export PATH=$PATH:$PWD/geckodriver
37+
- pip install -U pip
3938

4039
install:
41-
- "pip install tox-travis"
40+
- pip install tox-travis
41+
- pip install -r requirements/tox.txt
4242

4343
script:
4444
- tox
4545

4646
after_success:
47-
- "pip install coveralls"
48-
- "coveralls"
47+
- codecov

Makefile

+2-8
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,11 @@ $(SQLITE_DB): var
2626

2727
.PHONY: test
2828
test:
29-
python manage.py test
29+
tox
3030

3131
.PHONY: quality
3232
quality:
33-
pep8
34-
pylint workbench/ sample_xblocks/ setup.py
35-
36-
.PHONY: cover
37-
cover:
38-
coverage run manage.py test
39-
coverage report
33+
tox -e quality
4034

4135
clean:
4236
rm -f workbench.log* workbench.test.*

codecov.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
enabled: yes
6+
target: auto
7+
patch:
8+
default:
9+
enabled: yes
10+
target: 85%
11+
12+
comment: false

0 commit comments

Comments
 (0)