Skip to content

Commit 76d2031

Browse files
committed
improve testing.
- Check coverage for models - Fix twine check for long description - Use Python 3.7 for coverage and packaging checks - Remove claims about 2.7 support
1 parent 10283c1 commit 76d2031

File tree

4 files changed

+37
-55
lines changed

4 files changed

+37
-55
lines changed

.circleci/config.yml

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ workflows:
66
jobs:
77
- test-py37
88
- test-py36
9-
- test-py27
109
- check
1110

1211
jobs:
@@ -26,9 +25,10 @@ jobs:
2625
- checkout
2726
- restore_cache:
2827
keys:
29-
- rest-auth-toolkit-py37-v2-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
30-
- rest-auth-toolkit-py37-v2-{{ arch }}-{{ checksum "requirements-test.txt" }}
31-
- rest-auth-toolkit-py37-v2-{{ arch }}-
28+
- rest-auth-toolkit-py37-v5-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
29+
- rest-auth-toolkit-py37-v5-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
30+
- rest-auth-toolkit-py37-v5-{{ arch }}-{{ checksum "requirements-test.txt" }}
31+
- rest-auth-toolkit-py37-v5-{{ arch }}-
3232
- run:
3333
name: Install CI tools
3434
command: |
@@ -37,8 +37,11 @@ jobs:
3737
- run:
3838
name: Test with Python 3.7
3939
command: venv/bin/tox -e py37
40+
- run:
41+
name: Check coverage with Python 3.7
42+
command: venv/bin/tox -e coverage
4043
- save_cache:
41-
key: rest-auth-toolkit-py37-v2-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
44+
key: rest-auth-toolkit-py37-v5-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
4245
paths:
4346
- venv
4447
- .tox
@@ -58,9 +61,10 @@ jobs:
5861
- checkout
5962
- restore_cache:
6063
keys:
64+
- rest-auth-toolkit-py36-v3-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
6165
- rest-auth-toolkit-py36-v2-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
62-
- rest-auth-toolkit-py36-v2-{{ arch }}-{{ checksum "requirements-test.txt" }}
63-
- rest-auth-toolkit-py36-v2-{{ arch }}-
66+
- rest-auth-toolkit-py36-v3-{{ arch }}-{{ checksum "requirements-test.txt" }}
67+
- rest-auth-toolkit-py36-v3-{{ arch }}-
6468
- run:
6569
name: Install CI tools
6670
command: |
@@ -70,63 +74,29 @@ jobs:
7074
name: Test with Python 3.6
7175
command: venv/bin/tox -e py36
7276
- save_cache:
73-
key: rest-auth-toolkit-py36-v2-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
74-
paths:
75-
- venv
76-
- .tox
77-
78-
test-py27:
79-
docker:
80-
# This image contains Python 3.6 (to install flit) and 2.7 (to run tests)
81-
- image: circleci/python:3.6
82-
- image: circleci/postgres:9.6-alpine
83-
environment:
84-
POSTGRES_DB: circle_test
85-
POSTGRES_USER: testapp
86-
POSTGRES_PASSWORD: ""
87-
working_directory: ~/rest-auth-toolkit
88-
environment:
89-
DATABASE_URL: postgres://testapp@localhost/circle_test
90-
steps:
91-
- checkout
92-
- restore_cache:
93-
keys:
94-
- rest-auth-toolkit-py27-v2-{{ arch }}-{{ checksum "requirements-test.txt" }}
95-
- rest-auth-toolkit-py27-v2-{{ arch }}-
96-
- run:
97-
name: Install CI tools
98-
command: |
99-
python3.6 -m venv venv
100-
venv/bin/pip install tox
101-
- run:
102-
name: Test with Python 2.7
103-
command: |
104-
venv/bin/tox --sdistonly
105-
venv/bin/tox -e py27
106-
- save_cache:
107-
key: rest-auth-toolkit-py27-v2-{{ arch }}-{{ checksum "requirements-test.txt" }}
77+
key: rest-auth-toolkit-py36-v3-{{ arch }}-{{ checksum "requirements-test.txt" }}-{{ checksum "demo/requirements.txt" }}
10878
paths:
10979
- venv
11080
- .tox
11181

11282
check:
11383
docker:
114-
- image: circleci/python:3.6
84+
- image: circleci/python:3.7
11585
working_directory: ~/rest-auth-toolkit
11686
steps:
11787
- checkout
11888
- restore_cache:
119-
key: rest-auth-toolkit-check-v3
89+
key: rest-auth-toolkit-check-v5
12090
- run:
12191
name: Install CI tools
12292
command: |
123-
python3.6 -m venv venv
93+
python3.7 -m venv venv
12494
venv/bin/pip install tox
12595
- run:
12696
name: Check packaging and dependencies
12797
command: venv/bin/tox -e pkg
12898
- save_cache:
129-
key: rest-auth-toolkit-check-v3
99+
key: rest-auth-toolkit-check-v5
130100
paths:
131101
- venv
132102
- .tox

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Developers",
1515
"License :: OSI Approved :: MIT License",
16-
"Programming Language :: Python :: 2.7",
1716
"Programming Language :: Python :: 3.5",
1817
"Programming Language :: Python :: 3.6",
1918
"Programming Language :: Python :: 3.7",

requirements-test.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ pytest
44
pytest-env
55
pytest-django
66
pytest-pythonpath
7+
8+
coverage

tox.ini

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ passenv =
1010
commands =
1111
pip install -r requirements-test.txt -r demo/requirements.txt
1212
flake8 rest_auth_toolkit tests demo
13-
pytest
13+
pytest {posargs}
1414

15-
[testenv:py27]
16-
# can be removed if flit #218 is addressed
17-
install_command = python -m pip install --no-build-isolation {opts} {packages}
15+
[testenv:coverage]
16+
basepython = python3.7
1817
commands =
19-
pip install -r requirements-test.txt
20-
flake8 rest_auth_toolkit tests demo
21-
# skip tests for now, 2.7 can't install django 2 and auth migrations are different
18+
pip install -r requirements-test.txt -r demo/requirements.txt
19+
coverage run -m pytest -qq {posargs}
20+
coverage report
2221

2322
[testenv:pkg]
24-
basepython = python3.6
23+
basepython = python3.7
2524
deps =
2625
flit
2726
twine
27+
readme_renderer[md]
2828
safety >= 1.8.4
2929
commands =
3030
flit build
@@ -46,6 +46,17 @@ norecursedirs =
4646
migrations
4747
templates
4848

49+
[coverage:run]
50+
source = rest_auth_toolkit/models.py, rest_auth_toolkit/managers.py, tests
51+
branch = 1
52+
53+
[coverage:report]
54+
skip_covered = 1
55+
show_missing = 1
56+
fail_under = 100
57+
exclude_lines =
58+
pragma: no cover
59+
4960
[flake8]
5061
max-line-length = 89
5162
exclude = .git,.tox,__pycache__,migrations,templates

0 commit comments

Comments
 (0)