Merge pull request #151 from samjhill/feature/tests

add unit tests
This commit is contained in:
Michael 2024-07-19 16:40:11 +01:00 committed by GitHub
commit c09e19288e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1859 additions and 2 deletions

38
.github/workflows/pytest.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Run python unit tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install -r requirements.txt
- name: Run tests with coverage
run: |
pytest --cov=./ --cov-report=xml
- name: Save coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml

2
.gitignore vendored
View file

@ -1,4 +1,6 @@
.vscode/launch.json
artifacts/*
venv
.venv
.DS_Store
__pycache__

View file

@ -1,10 +1,14 @@
certifi==2024.7.4
charset-normalizer==3.0.1
defusedxml==0.7.1
docutils==0.19
idna==3.7
iniconfig==2.0.0
packaging==24.1
pluggy==1.5.0
pytest==8.2.2
python-dateutil==2.8.2
requests==2.32.0
six==1.16.0
smmap==5.0.0
urllib3==1.26.19
defusedxml==0.7.1

0
tests/__init__.py Normal file
View file

1813
tests/test_find_posts.py Normal file

File diff suppressed because it is too large Load diff