Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup test suite #6

Merged
merged 4 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
test:
name: "Test"
runs-on: "ubuntu-20.04"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "3.8"
- name: "Install dependencies"
run: scripts/install
- name: "Run tests"
run: scripts/test
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ Lancer le scraper (il tourne périodiquement, cf `.github/workflows/scrape.yml`)
```bash
scripts/scrape
```

Exécuter les tests :

```bash
scripts/test
```
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requests[socks]==2.25.1
pytest==6.2.2
7 changes: 7 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh -e

BIN="venv/bin/"

set -x

${BIN}pytest
Empty file added tests/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions tests/test_scrape.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_todo():
import prototype # TODO