Skip to content

Commit

Permalink
Merge pull request #6 from mostafa/add-tests
Browse files Browse the repository at this point in the history
Add tests, CI and other things
  • Loading branch information
ezrajrice committed Nov 3, 2022
2 parents eeebdad + eca5eda commit a3cc791
Show file tree
Hide file tree
Showing 12 changed files with 627 additions and 82 deletions.
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
max-line-length = 100
per-file-ignores =
django_advanced_password_validation/tests/settings.py: E501
exclude =
dist,
build,
env,
venv,
.env,
.venv,
37 changes: 37 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test

on: [push, pull_request]

jobs:
test:
name: Test django-advanced-password-validation
runs-on: ubuntu-latest
strategy:
matrix:
versions:
- { "djangoVersion": "4.1.2", "pythonVersion": "3.10" }
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Set up Python 🐍
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.versions.pythonVersion }}
- name: Install dependencies 📦
run: python -m pip install -r requirements_test.txt && python -m pip install -e .
- name: Install Django ${{ matrix.versions.djangoVersion }} 📦
run: python -m pip install Django==${{ matrix.versions.djangoVersion }}
- name: Check types, syntax and duckstrings 🦆
run: |
mypy --exclude=setup.py .
flake8 .
interrogate --quiet --fail-under=90 .
- name: Test Django ${{ matrix.versions.djangoVersion }} with coverage 🧪
run: coverage run --source=django_advanced_password_validation -m pytest . && coverage lcov -o coverage.lcov
- name: Submit coverage report to Coveralls 📈
if: ${{ success() }}
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.lcov

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
dist/
*.egg-info/
.vs/
.vs/
__pycache__
4 changes: 1 addition & 3 deletions django_advanced_password_validation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from . import advanced_password_validation

__all__ = [
'advanced_password_validation'
]
__all__ = ["advanced_password_validation"]
Loading

0 comments on commit a3cc791

Please sign in to comment.