Skip to content

Commit

Permalink
init pytest commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Lash-L committed Mar 1, 2023
1 parent fa934ab commit 704dc4b
Show file tree
Hide file tree
Showing 9 changed files with 651 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: pre-commit/[email protected]

test:
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
os:
- ubuntu-latest
- windows-latest
- macOS-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: snok/[email protected]
- name: Install Dependencies
run: poetry install
shell: bash
- name: Test with Pytest
run: poetry run pytest --cov-report=xml
shell: bash
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ venv
.idea
roborock/__pycache__
poetry.lock
*.pyc
.coverage
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ paho-mqtt = "~1.6.1"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[project.optional-dependencies]
test = [
"pytest-asyncio= *"
]
2 changes: 0 additions & 2 deletions roborock/roborock_queue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
from asyncio import Queue
from typing import Any
import async_timeout
Expand All @@ -7,7 +6,6 @@


class RoborockQueue(Queue):

def __init__(self, protocol: int, *args):
super().__init__(*args)
self.protocol = protocol
Expand Down
Empty file added tests/__init__.py
Empty file.
Loading

0 comments on commit 704dc4b

Please sign in to comment.