mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 11:42:54 +03:00
Use pytest for running tests
This commit is contained in:
parent
7cdd1f4490
commit
2cb80431cc
@ -13,15 +13,20 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Install packages
|
name: Install packages
|
||||||
command: apk add postgresql-libs gcc musl-dev postgresql-dev git
|
command: apk add postgresql-libs gcc musl-dev postgresql-dev git
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install Python packages
|
name: Install Python packages
|
||||||
command: pip install -r requirements/test.txt
|
command: pip install -r requirements/test.txt
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Run tests
|
name: Run tests
|
||||||
command: tox -e 'py37-dj{20,21,22}'
|
command: tox -e 'py37-dj{20,21,22}'
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: 'postgres://localizedfields:localizedfields@localhost:5432/localizedfields'
|
DATABASE_URL: 'postgres://localizedfields:localizedfields@localhost:5432/localizedfields'
|
||||||
|
|
||||||
|
- store_test_results:
|
||||||
|
path: reports
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
docker:
|
docker:
|
||||||
- image: python:3.7-alpine
|
- image: python:3.7-alpine
|
||||||
@ -30,12 +35,14 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Install packages
|
name: Install packages
|
||||||
command: apk add postgresql-libs gcc musl-dev postgresql-dev git
|
command: apk add postgresql-libs gcc musl-dev postgresql-dev git
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install Python packages
|
name: Install Python packages
|
||||||
command: pip install -r requirements/test.txt
|
command: pip install -r requirements/test.txt
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Lint code
|
name: Verify formatting / linting
|
||||||
command: python setup.py lint
|
command: python setup.py verify
|
||||||
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
# Ignore virtual environments
|
# Ignore virtual environments
|
||||||
env/
|
env/
|
||||||
.env/
|
.env/
|
||||||
|
venv/
|
||||||
|
|
||||||
# Ignore Python byte code cache
|
# Ignore Python byte code cache
|
||||||
*.pyc
|
*.pyc
|
||||||
@ -9,7 +10,7 @@ __pycache__
|
|||||||
|
|
||||||
# Ignore coverage reports
|
# Ignore coverage reports
|
||||||
.coverage
|
.coverage
|
||||||
htmlcov
|
reports/
|
||||||
|
|
||||||
# Ignore build results
|
# Ignore build results
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
|
4
pytest.ini
Normal file
4
pytest.ini
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[pytest]
|
||||||
|
DJANGO_SETTINGS_MODULE=settings
|
||||||
|
testpaths=tests
|
||||||
|
addopts=-m "not benchmark"
|
@ -16,7 +16,7 @@ pytest==5.2.1
|
|||||||
pytest-django==3.6.0
|
pytest-django==3.6.0
|
||||||
pytest-cov==2.8.1
|
pytest-cov==2.8.1
|
||||||
|
|
||||||
|
# Test support
|
||||||
django-autoslug==1.9.3
|
django-autoslug==1.9.3
|
||||||
django-bleach==0.3.0
|
django-bleach==0.3.0
|
||||||
psycopg2==2.7.3.2
|
psycopg2==2.7.3.2
|
||||||
coverage==4.4.2
|
|
||||||
|
14
setup.py
14
setup.py
@ -138,5 +138,19 @@ setup(
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
"test": create_command(
|
||||||
|
"Runs all the tests",
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"pytest",
|
||||||
|
"--cov=localized_fields",
|
||||||
|
"--cov-report=term",
|
||||||
|
"--cov-report=xml:reports/xml",
|
||||||
|
"--cov-report=html:reports/html",
|
||||||
|
"--junitxml=reports/junit/tests.xml",
|
||||||
|
"--reuse-db",
|
||||||
|
]
|
||||||
|
],
|
||||||
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user