Skip to content

Commit cb011af

Browse files
committed
try github workflows again since travis-ci costs money now...
1 parent 3a7ba8f commit cb011af

4 files changed

Lines changed: 47 additions & 10 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ "master", "development" ]
9+
pull_request:
10+
branches: [ "master", "development" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11", "3.12"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install -r requirements-dev.txt
31+
python -m pip install .
32+
- name: Lint with flake8
33+
run: |
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36+
- name: Test with pytest
37+
env:
38+
TOKEN: ${{ secrets.TOKEN }}
39+
BASE_URL: ${{ secrets.BASE_URL }}
40+
run: |
41+
pytest

tests/test_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class TestAsyncClient(unittest.IsolatedAsyncioTestCase):
1919
async def asyncSetUp(self):
2020
session = aiohttp.ClientSession(trust_env=True)
2121
self.client = brawlstats.Client(
22-
token=os.getenv('token'),
22+
token=os.getenv('TOKEN'),
2323
session=session,
24-
base_url=os.getenv('base_url'),
24+
base_url=os.getenv('BASE_URL'),
2525
is_async=True
2626
)
2727

tests/test_blocking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class TestBlockingClient(unittest.TestCase):
1414

1515
def setUp(self):
1616
self.client = brawlstats.Client(
17-
token=os.getenv('token'),
18-
base_url=os.getenv('base_url')
17+
token=os.getenv('TOKEN'),
18+
base_url=os.getenv('BASE_URL')
1919
)
2020

2121
def tearDown(self):

tox.ini

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@ ignore = E252,E302,E731,W605
66
[tox]
77
envlist = py39, py310, py311, py312
88

9-
[pytest]
10-
filterwarnings =
11-
ignore:"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead:DeprecationWarning
12-
139
[testenv]
1410
deps = -Ur{toxinidir}/requirements-dev.txt
1511
commands =
1612
flake8 .
1713
pytest
1814
passenv =
19-
token
20-
base_url
15+
TOKEN
16+
BASE_URL

0 commit comments

Comments
 (0)