Skip to content

Commit 81e49ed

Browse files
authored
tests: added download tests and linting (#43)
1 parent 7df1b61 commit 81e49ed

37 files changed

+349
-96
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ jobs:
4040
pip install -r local-requirements.txt
4141
pip install .
4242
- name: Lint
43-
run: black --check .
43+
run: |
44+
black --check .
45+
mypy .
46+
flake8 playwright tests
4447
- name: Build driver
4548
run: python build_driver.py
4649
env:

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ repos:
1616
rev: v0.782
1717
hooks:
1818
- id: mypy
19+
- repo: https://gitlab.com/pycqa/flake8
20+
rev: 'a7be77f761a4c29121d6bb6f61c11902281f9105'
21+
hooks:
22+
- id: flake8

local-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ twisted==20.3.0
99
wheel==0.34.2
1010
black==19.10b0
1111
pre-commit==2.6.0
12+
flake8==3.8.3

playwright/accessibility.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
from playwright.connection import Channel
16-
from playwright.helper import locals_to_params
1716
from playwright.element_handle import ElementHandle
1817
from typing import Dict
1918

playwright/browser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
import sys
1616
from playwright.browser_context import BrowserContext
17-
from playwright.connection import Channel, ChannelOwner, ConnectionScope, from_channel
17+
from playwright.connection import ChannelOwner, ConnectionScope, from_channel
1818
from playwright.helper import locals_to_params, ColorScheme
1919
from playwright.page import Page
2020
from types import SimpleNamespace
21-
from typing import Dict, List, Optional, Union
21+
from typing import Dict, List, Union
2222

2323
if sys.version_info >= (3, 8):
2424
from typing import Literal

playwright/browser_context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414

1515
import asyncio
1616
from playwright.connection import (
17-
Channel,
1817
ChannelOwner,
1918
ConnectionScope,
2019
from_channel,
21-
from_nullable_channel,
2220
)
2321
from playwright.helper import (
2422
Cookie,
@@ -31,7 +29,7 @@
3129
URLMatch,
3230
URLMatcher,
3331
)
34-
from playwright.network import Request, Response, Route
32+
from playwright.network import Request, Route
3533
from playwright.page import BindingCall, Page
3634
from types import SimpleNamespace
3735
from typing import Any, Callable, Dict, List, Optional, Union, TYPE_CHECKING

playwright/browser_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from playwright.connection import Channel, ChannelOwner, ConnectionScope
15+
from playwright.connection import ChannelOwner, ConnectionScope
1616
from types import SimpleNamespace
1717
from typing import Dict
1818

playwright/browser_type.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from playwright.connection import Channel, ChannelOwner, ConnectionScope, from_channel
15+
from playwright.connection import ChannelOwner, ConnectionScope, from_channel
1616
from playwright.browser import Browser
1717
from playwright.browser_context import BrowserContext
1818
from playwright.helper import locals_to_params, ColorScheme
19-
from typing import Awaitable, Dict, List
19+
from typing import Dict, List
2020

2121

2222
class BrowserType(ChannelOwner):

playwright/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from playwright.helper import parse_error, ParsedMessagePayload
1717
from playwright.transport import Transport
1818
from pyee import BaseEventEmitter
19-
from typing import Any, Awaitable, Dict, List, Optional
19+
from typing import Any, Dict, List, Optional
2020

2121

2222
class Channel(BaseEventEmitter):

playwright/console_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from playwright.connection import Channel, ChannelOwner, ConnectionScope, from_channel
15+
from playwright.connection import ChannelOwner, ConnectionScope, from_channel
1616
from playwright.helper import ConsoleMessageLocation
1717
from playwright.js_handle import JSHandle
1818
from typing import Dict, List

0 commit comments

Comments
 (0)