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

feat: Update test mocks, add testing with Python 3.13 #46

Merged
merged 2 commits into from
Oct 23, 2024
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
3 changes: 3 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- os: ubuntu-latest
python: '3.12'
toxenv: py
- os: ubuntu-latest
python: '3.13'
toxenv: py
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the code
Expand Down
5 changes: 4 additions & 1 deletion custom_components/gs_alarm/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ async def async_step_init(
'client', None
)

schema = {
schema: dict[
vol.Required | vol.Optional,
SelectSelector | BooleanSelector
] = {
vol.Required(
"sms_alert_when_armed",
default=self.config_entry.options.get(
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ log_cli_level = "error"
# Workaround for
# https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/issues/129
asyncio_mode = "auto"

[[tool.mypy.overrides]]
module = "voluptuous"
ignore_missing_imports = true
# Introduced by `pytest-asyncio` recently
asyncio_default_fixture_loop_scope = "function"

[[tool.mypy.overrides]]
module = "pytest_homeassistant_custom_component.common"
Expand Down
10 changes: 5 additions & 5 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
flake8==7.0.0
pylint==3.0.3
coverage==7.5.0
pytest-homeassistant-custom-component==0.13.132
pytest==8.2.0
coverage==7.6.1
pytest-homeassistant-custom-component==0.13.174
pytest==8.3.3
pytest-cov==5.0.0
pytest-unordered==0.6.0
pytest-unordered==0.6.1
mypy[reports]==1.11.1
pyg90alarm==1.15.1
pyg90alarm==1.16.0
11 changes: 2 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
# Python 3.10 is no longer supported by HASS, see
# https://github.com/home-assistant/core/pull/98640
envlist = py{312}
envlist = py{312,313}

# Define the minimal tox version required to run;
# if the host tox is less than this the tool with create an environment and
Expand All @@ -22,22 +22,15 @@ skipsdist=true
deps =
-rrequirements_dev.txt

allowlist_externals =
cat

setenv =
# Allow tests to import the custom compontent using
# `custom_components.<...>` names
PYTHONPATH = {toxinidir}

commands =
flake8 --tee --output-file=flake8.txt custom_components/ tests/
pylint --output-format=parseable --output=pylint.txt custom_components/ tests/
pylint --output-format=parseable:pylint.txt custom_components/ tests/
mypy --strict --cobertura-xml-report=mypy/ custom_components/ tests/
# Ensure only traces for in-repository module is processed, not for one
# installed by `tox` (see above for more details)
pytest --cov=custom_components/ --cov-append --cov-report=term-missing -v tests/ []

commands_post =
# Show the `pylint` report to the standard output, to ease fixing the issues reported
cat pylint.txt
Loading