8000 Add flake8-pytest-style (PT) for ruff by rytilahti · Pull Request #1105 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Add flake8-pytest-style (PT) for ruff #1105

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

Merged
merged 6 commits into from
Aug 30, 2024
Merged

Add flake8-pytest-style (PT) for ruff #1105

merged 6 commits into from
Aug 30, 2024

Conversation

rytilahti
Copy link
Member
@rytilahti rytilahti commented Aug 30, 2024

This will catch common issues with pytest code.

  • Use match when using pytest.raises() for base exception types like TypeError or ValueError
  • Use tuples for parametrize()
  • Enforces pytest.raises() to contain simple statements, using noqa to skip this on some cases for now.
  • Fixes incorrect exception type (valueerror instead of typeerror) for iotdimmer.
  • Adds check valid types for iotbulb.set_hsv and color smart module.
  • Consolidate exception messages for common interface modules.

@rytilahti rytilahti added the maintenance Project improvements and maintenance label Aug 30, 2024
@rytilahti rytilahti changed the title Add flake8-pytest-style (PT) for ruff checks Add flake8-pytest-style (PT) for ruff Aug 30, 2024
@rytilahti rytilahti requested a review from sdb9696 August 30, 2024 14:16
Copy link
codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.60%. Comparing base (3e43781) to head (1aaad14).
Report is 164 commits behind head on master.

Files with missing lines Patch % Lines
kasa/iot/iotdimmer.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1105      +/-   ##
==========================================
+ Coverage   92.58%   92.60%   +0.01%     
==========================================
  Files          96       96              
  Lines        6072     6084      +12     
  Branches     1496     1502       +6     
==========================================
+ Hits         5622     5634      +12     
  Misses        351      351              
  Partials       99       99              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator
@sdb9696 sdb9696 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rytilahti rytilahti merged commit 6a86ffb into master Aug 30, 2024
30 checks passed
@rytilahti rytilahti deleted the janitor/ruff_pt branch August 30, 2024 15:30
sdb9696 pushed a commit that referenced this pull request Aug 30, 2024
This will catch common issues with pytest code.

* Use `match` when using `pytest.raises()` for base exception types like
`TypeError` or `ValueError`
* Use tuples for `parametrize()`
* Enforces `pytest.raises()` to contain simple statements, using `noqa`
to skip this on some cases for now.
* Fixes incorrect exception type (valueerror instead of typeerror) for
iotdimmer.
* Adds check valid types for `iotbulb.set_hsv` and `color` smart module.
* Consolidate exception messages for common interface modules.
@sdb9696 sdb9696 added this to the 0.7.2 milestone Aug 30, 2024
@sdb9696 sdb9696 mentioned this pull request Aug 30, 2024
sdb9696 added a commit that referenced this pull request Aug 30, 2024
## [0.7.2](https://github.com/python-kasa/python-kasa/tree/0.7.2) (2024-08-30)

[Full Changelog](0.7.1...0.7.2)

**Release summary:**

- **Breaking** change to disable including the check for the latest firmware for tapo devices and newer kasa devices in the standard update cycle. To check for the latest firmware call `check_latest_firmware` on the firmware module or run the `check_latest_firmware` feature.
- Minor bugfixes and improvements.

**Breaking changes:**

- Disable automatic updating of latest firmware [\#1103](#1103) (@sdb9696)

**Implemented enhancements:**

- Improve performance of dict merge code [\#1097](#1097) (@bdraco)

**Fixed bugs:**

- Fix logging in iotdevice when a module is module not supported [\#1100](#1100) (@bdraco)

**Documentation updates:**

- Fix incorrect docs link in contributing.md [\#1099](#1099) (@sdb9696)

**Project maintenance:**

- Add flake8-pytest-style \(PT\) for ruff [\#1105](#1105) (@rytilahti)
- Add flake8-logging \(LOG\) and flake8-logging-format \(G\) for ruff [\#1104](#1104) (@rytilahti)
- Add missing typing\_extensions dependency [\#1101](#1101) (@sdb9696)
- Remove top level await xdoctest fixture [\#1098](#1098) (@sdb9696)
- Enable python 3.13, allow pre-releases for CI [\#1086](#1086) (@rytilahti)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Project improvements and maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0