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

GitHub Actions による自動テスト実行 #49

Merged
merged 6 commits into from
Jun 11, 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
26 changes: 26 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pytest

on: [push, pull_request]

jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
poetry-version: [1.1.6]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Set up Poetry virtualenv
run: poetry env use python${{ matrix.python-version }}
- name: Install dependency libraries
run: poetry install
- name: Run Tests
run: poetry run pytest
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![pytest](https://github.com/MtkN1/pybotters/actions/workflows/pytest.yml/badge.svg)](https://github.com/MtkN1/pybotters/actions/workflows/pytest.yml)

# [BETA] pybotters

An advanced api client for python botters.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def test_client_open(mocker: pytest_mock.MockerFixture):
'name2': tuple(['key2', 'secret2'.encode()]),
'name3': tuple(['key3', 'secret3'.encode()]),
}
m.assert_called_once_with('/path/to/apis.json', encoding='utf-8')
m.assert_called_once_with(apis)


async def test_client_warn(mocker: pytest_mock.MockerFixture):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from yarl import URL

import pybotters.auth
import pybotters.request
from pybotters.request import ClientRequest


async def test_request_without_auth(mocker: pytest_mock.MockerFixture):
Expand All @@ -13,7 +13,7 @@ async def test_request_without_auth(mocker: pytest_mock.MockerFixture):
mocker.patch.object(pybotters.auth.Hosts, 'items', items)
m_sesison = mocker.MagicMock()
m_sesison.__dict__['_apis'] = {}
req = pybotters.request.ClientRequest(
req = ClientRequest(
'GET',
URL('http://example.com'),
params={'foo': 'bar'},
Expand All @@ -32,7 +32,7 @@ async def test_request_with_auth(mocker: pytest_mock.MockerFixture):
mocker.patch.object(pybotters.auth.Hosts, 'items', items)
m_sesison = mocker.MagicMock()
m_sesison.__dict__['_apis'] = {'example': ('key', 'secret'.encode())}
req = pybotters.request.ClientRequest(
req = ClientRequest(
'GET',
URL('http://example.com'),
params={'foo': 'bar'},
Expand Down