Skip to content

Commit 61b1a03

Browse files
chore: remove redundant code (microsoft#759)
1 parent e05ab07 commit 61b1a03

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ repos:
1010
- id: check-toml
1111
- id: requirements-txt-fixer
1212
- repo: https://github.com/psf/black
13-
rev: 21.5b1
13+
rev: 21.6b0
1414
hooks:
1515
- id: black
1616
- repo: https://github.com/pre-commit/mirrors-mypy
17-
rev: v0.812
17+
rev: v0.902
1818
hooks:
1919
- id: mypy
2020
- repo: https://gitlab.com/pycqa/flake8

local-requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
auditwheel==4.0.0
22
autobahn==21.3.1
3-
black==21.5b1
3+
black==21.6b0
44
flake8==3.9.2
55
flaky==3.7.0
6-
mypy==0.812
6+
mypy==0.902
77
objgraph==3.5.0
88
pandas==1.2.4
99
Pillow==8.2.0
1010
pixelmatch==0.2.3
11-
pre-commit==2.12.1
11+
pre-commit==2.13.0
1212
pyOpenSSL==20.0.1
1313
pytest==6.2.4
1414
pytest-asyncio==0.15.1
15-
pytest-cov==2.12.0
15+
pytest-cov==2.12.1
1616
pytest-repeat==0.9.1
1717
pytest-sugar==0.9.4
1818
pytest-timeout==1.4.2
1919
pytest-xdist==2.2.1
2020
requests==2.25.1
2121
service_identity==21.1.0
22-
setuptools==56.2.0
22+
setuptools==57.0.0
2323
twine==3.4.1
2424
twisted==21.2.0
2525
wheel==0.36.2

playwright/_impl/_js_handle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def serialize_value(value: Any, handles: List[JSHandle], depth: int) -> Any:
122122
return dict(a=result)
123123

124124
if isinstance(value, dict):
125-
result = [] # type: ignore
125+
result = []
126126
for name in value:
127127
result.append(
128128
{"k": name, "v": serialize_value(value[name], handles, depth + 1)}

scripts/generate_async_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import inspect
1717
import re
1818
from types import FunctionType
19-
from typing import Any, get_type_hints # type: ignore
19+
from typing import Any, get_type_hints
2020

2121
from playwright._impl._helper import to_snake_case
2222
from scripts.documentation_provider import DocumentationProvider
@@ -59,7 +59,7 @@ def generate(t: Any) -> None:
5959
for [name, value] in t.__dict__.items():
6060
if name.startswith("_"):
6161
continue
62-
if not name.startswith("_") and str(value).startswith("<property"):
62+
if str(value).startswith("<property"):
6363
value = value.fget
6464
print("")
6565
print(" @property")

scripts/generate_sync_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re
1818
import sys
1919
from types import FunctionType
20-
from typing import Any, get_type_hints # type: ignore
20+
from typing import Any, get_type_hints
2121

2222
from playwright._impl._helper import to_snake_case
2323
from scripts.documentation_provider import DocumentationProvider
@@ -60,7 +60,7 @@ def generate(t: Any) -> None:
6060
for [name, value] in t.__dict__.items():
6161
if name.startswith("_"):
6262
continue
63-
if not name.startswith("_") and str(value).startswith("<property"):
63+
if str(value).startswith("<property"):
6464
value = value.fget
6565
print("")
6666
print(" @property")

setup.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ junit_family=xunit2
99
[mypy]
1010
ignore_missing_imports = True
1111
python_version = 3.7
12-
warn_unused_ignores = False
12+
warn_unused_ignores = True
1313
warn_redundant_casts = True
1414
warn_unused_configs = True
1515
check_untyped_defs = True
1616
disallow_untyped_defs = True
1717
[mypy-tests.*]
18-
check_untyped_defs = False
19-
disallow_untyped_defs = False
18+
ignore_errors = True
2019
[flake8]
2120
ignore =
2221
E501

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def __init__(
219219
node_executable = driver_dir / "node"
220220
cli_js = driver_dir / "package" / "lib" / "cli" / "cli.js"
221221
tmpfile.write_text(json.dumps(launch_server_options))
222-
self.process = subprocess.Popen( # type: ignore
222+
self.process = subprocess.Popen(
223223
[
224224
str(node_executable),
225225
str(cli_js),

0 commit comments

Comments
 (0)