10000 Enable ruff lint pycodestyle warnings (#1132) · msz-coder/python-kasa@936e45c · GitHub
[go: up one dir, main page]

Skip to content

Commit 936e45c

Browse files
authored
Enable ruff lint pycodestyle warnings (python-kasa#1132)
Addresses repeated SyntaxWarnings when running linters: ``` kasa/tests/test_bulb.py:254: SyntaxWarning: invalid escape sequence '\d' ValueError, match="Temperature should be between \d+ and \d+, was 1000" kasa/tests/test_bulb.py:258: SyntaxWarning: invalid escape sequence '\d' ValueError, match="Temperature should be between \d+ and \d+, was 10000" kasa/tests/test_common_modules.py:216: SyntaxWarning: invalid escape sequence '\d' with pytest.raises(ValueError, match="Temperature should be between \d+ and \d+"): kasa/tests/test_common_modules.py:219: SyntaxWarning: invalid escape sequence '\d' with pytest.raises(ValueError, match="Temperature should be between \d+ and \d+"): ```
1 parent db686e1 commit 936e45c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

kasa/tests/test_bulb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ async def test_out_of_range_temperature(dev: Device):
251251
light = dev.modules.get(Module.Light)
252252
assert light
253253
with pytest.raises(
254-
ValueError, match="Temperature should be between \d+ and \d+, was 1000"
254+
ValueError, match=r"Temperature should be between \d+ and \d+, was 1000"
255255
):
256256
await light.set_color_temp(1000)
257257
with pytest.raises(
258-
ValueError, match="Temperature should be between \d+ and \d+, was 10000"
258+
ValueError, match=r"Temperature should be between \d+ and \d+, was 10000"
259259
):
260260
await light.< 8000 span class=pl-c1>set_color_temp(10000)
261261

kasa/tests/test_common_modules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ async def test_light_color_temp(dev: Device):
213213
assert light.color_temp == feature.minimum_value + 20
214214
assert light.brightness == 60
215215

216-
with pytest.raises(ValueError, match="Temperature should be between \d+ and \d+"):
216+
with pytest.raises(ValueError, match=r"Temperature should be between \d+ and \d+"):
217217
await light.set_color_temp(feature.minimum_value - 10)
218218

219-
with pytest.raises(ValueError, match="Temperature should be between \d+ and \d+"):
219+
with pytest.raises(ValueError, match=r"Temperature should be between \d+ and \d+"):
220220
await light.set_color_temp(feature.maximum_value + 10)
221221

222222

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ target-version = "py38"
120120

121121
[tool.ruff.lint]
122122
select = [
123-
"E", # pycodestyle
123+
"E", # pycodestyle errors
124+
"W", # pycodestyle warnings
124125
"D", # pydocstyle
125126
"F", # pyflakes
126127
"UP", # pyupgrade

0 commit comments

Comments
 (0)
0