Skip to content

Commit

Permalink
Setup test suite (#6)
Browse files Browse the repository at this point in the history
* Setup pytest

* Update README, add test workflow

* Update .github/workflows/test.yml
  • Loading branch information
florimondmanca authored Apr 2, 2021
1 parent 8a90ea6 commit f49a66e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 0 deletions.
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

0 comments on commit f49a66e

Please sign in to comment.