Skip to content

Commit 81c6425

Browse files
committed
Fix some inconsistencies on dev tooling
* Add flake8 to dev dependencies * Add possibility to run unittests via inv * include tasks.py in lint target * fixed some typos
1 parent 52d8f50 commit 81c6425

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ build
1818
.pabotsuitenames
1919
.mypy_cache
2020
stub_files
21+
venv/

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pytest-approvaltests >= 0.1.0
1010
requests >= 2.24.0
1111
robotframework-pabot >= 1.10.0
1212
black >= 20.8b1
13+
flake8 >= 3.9.0
1314

1415
# Requirements needed when generating releases. See BUILD.rst for details.
1516
rellu >= 0.6

tasks.py

+20-7
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ def kw_docs(ctx, version=None):
8585
gtag('config', 'UA-106835747-4', {
8686
'anonymize_ip': true,
8787
'page_path': location.pathname+location.search+location.hash });
88-
window.onhashchange = function() {
88+
window.onhashchange = function() {
8989
gtag('event', 'HashChange', {
9090
'event_category': 'Subsection',
9191
'event_label': window.location.hash
9292
});
93-
}
93+
}
9494
"""
9595
soup.head.append(script_data)
9696
with out.open("w") as file:
@@ -188,8 +188,8 @@ def init_labels(ctx, username=None, password=None):
188188
@task
189189
def lint(ctx):
190190
"""Runs black and flake8 for project Python code."""
191-
ctx.run("black --config pyproject.toml src/ utest/ atest/")
192-
ctx.run("flake8 --config .flake8 src/ utest/ atest/")
191+
ctx.run("black --config pyproject.toml tasks.py src/ utest/ atest/")
192+
ctx.run("flake8 --config .flake8 tasks.py src/ utest/ atest/")
193193

194194

195195
@task
@@ -208,7 +208,20 @@ def atest(ctx, suite=None):
208208
Args:
209209
suite: Select which suite to run.
210210
"""
211-
commad = "python atest/run.py headlesschrome"
211+
command = "python atest/run.py headlesschrome"
212212
if suite:
213-
commad = f"{commad} --suite {suite}"
214-
ctx.run(commad)
213+
command = f"{command} --suite {suite}"
214+
ctx.run(command)
215+
216+
217+
@task
218+
def utest(ctx, suite=None):
219+
"""Runs utest/run.py
220+
221+
Args:
222+
suite: Select which suite to run.
223+
"""
224+
command = "python utest/run.py"
225+
if suite:
226+
command = f"{command} --suite {suite}"
227+
ctx.run(command)

utest/test/locators/test_elementfinder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def test_usage_of_multiple_locators_using_list(finder):
678678
assert result == img_elements
679679

680680

681-
def test_localtor_split(finder: ElementFinder, reporter: GenericDiffReporterFactory):
681+
def test_locator_split(finder: ElementFinder, reporter: GenericDiffReporterFactory):
682682
results = [
683683
finder._split_locator("//div"),
684684
finder._split_locator("xpath://div"),

0 commit comments

Comments
 (0)