Skip to content

Commit 05896d1

Browse files
committed
Use pre-commit similar to what pytest does
1 parent 199fd56 commit 05896d1

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

pre-commit-config.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
3+
- repo: https://github.com/psf/black
4+
rev: stable
5+
hooks:
6+
- id: black
7+
args: [--safe, --quiet]
8+
language_version: python3
9+
10+
- repo: https://gitlab.com/pycqa/flake8
11+
rev: 3.7.7
12+
hooks:
13+
- id: flake8
14+
language_version: python3

pytest_selenium/drivers/appium.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
PORT = os.environ.get("APPIUM_PORT", 4723)
99

1010

11+
1112
def driver_kwargs(capabilities, host, port, **kwargs):
1213
executor = "http://{0}:{1}/wd/hub".format(host, port)
1314
kwargs = {"command_executor": executor, "desired_capabilities": capabilities}

tox.ini

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py{27,36,37,py,py3}, docs, flake8, black
7+
envlist = py{27,36,37,py,py3}, docs, linting
88

99
[testenv]
1010
passenv = PYTEST_ADDOPTS
@@ -22,6 +22,12 @@ changedir = docs
2222
deps = sphinx
2323
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
2424

25+
[testenv:linting]
26+
skip_install = True
27+
basepython = python3
28+
deps = pre-commit
29+
commands = pre-commit run --all-files --show-diff-on-failure
30+
2531
[testenv:flake8]
2632
skip_install = true
2733
basepython = python

0 commit comments

Comments
 (0)