Skip to content

Commit 2d066c5

Browse files
committed
adds ci workflow for automated testing
Sets up a GitHub Actions workflow to run tests on push and pull requests to the main branch. The workflow uses multiple Python versions to ensure compatibility across different environments.
1 parent b7b8cc2 commit 2d066c5

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- run: python -m pip install --upgrade pip
24+
- run: python -m unittest src.screenshotmax.tests.test_client
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file marks the tests directory as a Python package, enabling relative imports
2+

src/screenshotmax/tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
requests_stub.patch = lambda *args, **kwargs: None
1515
sys.modules.setdefault('requests', requests_stub)
1616

17-
from screenshotmax.client import APIClient
17+
from ..client import APIClient
1818

1919

2020
class TestAPIClient(unittest.TestCase):

0 commit comments

Comments
 (0)