Skip to content

Commit 27e4542

Browse files
authored
Merge pull request #470 from Dor-bl/mock-tests-action
CI: Add GitHub Actions workflow for mock tests
2 parents a9e90c0 + be85d1d commit 27e4542

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/unit-tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Mock Unit Tests
2+
3+
on:
4+
push:
5+
branches: [ "master", "main"]
6+
pull_request:
7+
branches: [ "master", "main"]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [ "3.10", "3.11" ]
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install Dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
# Added 'pytest-cov' to fix the error
29+
pip install pytest mock pytest-cov
30+
31+
# Install the library itself
32+
pip install .
33+
34+
if [ -f utest/requirements.txt ]; then pip install -r utest/requirements.txt; fi
35+
36+
- name: Run Mock Tests
37+
run: |
38+
# -v gives verbose output so you can see exactly which tests pass/fail
39+
pytest -v tests/

0 commit comments

Comments
 (0)