Skip to content

Commit 9933195

Browse files
committed
Linting test
1 parent fd96163 commit 9933195

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.github/workflows/accessibility-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v4
2020
with:
21-
python-version: '3.10'
21+
python-version: "3.10"
2222

2323
- name: Install dependencies
2424
run: |
@@ -32,4 +32,4 @@ jobs:
3232
3333
- name: Run accessibility tests
3434
run: |
35-
python3 -m pytest tests/
35+
python3 -m pytest tests/

tests/test.py

+20-11
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Starter(ProcessStarter):
4545
# Clean up the process
4646
xprocess.getinfo("page_url").terminate()
4747

48+
4849
def test_accessibility(page_url: tuple[Page, str]):
4950
"""Run accessibility tests on the homepage"""
5051
page, live_server_url = page_url
@@ -53,7 +54,10 @@ def test_accessibility(page_url: tuple[Page, str]):
5354
axe = Axe()
5455
results = axe.run(page)
5556

56-
assert len(results["violations"]) == 0, f"Accessibility violations found: {results['violations']}"
57+
assert (
58+
len(results["violations"]) == 0
59+
), f"Accessibility violations found: {results['violations']}"
60+
5761

5862
def test_destination(
5963
loaded_route: str,
@@ -94,8 +98,9 @@ def test_headers_in_language(page_url: tuple[Page, str], route: str) -> None:
9498
axe = Axe()
9599
results = axe.run(page)
96100

97-
assert len(results["violations"]) == 0, f"Accessibility violations found: {results['violations']}"
98-
101+
assert (
102+
len(results["violations"]) == 0
103+
), f"Accessibility violations found: {results['violations']}"
99104

100105

101106
@pytest.mark.parametrize(
@@ -117,8 +122,9 @@ def test_bpdevs_title_en(page_url: tuple[Page, str], title: str, url: str) -> No
117122
axe = Axe()
118123
results = axe.run(page)
119124

120-
assert len(results["violations"]) == 0, f"Accessibility violations found: {results['violations']}"
121-
125+
assert (
126+
len(results["violations"]) == 0
127+
), f"Accessibility violations found: {results['violations']}"
122128

123129

124130
def test_mailto_bpdevs(page_url: tuple[Page, str]) -> None:
@@ -130,8 +136,9 @@ def test_mailto_bpdevs(page_url: tuple[Page, str]) -> None:
130136
axe = Axe()
131137
results = axe.run(page)
132138

133-
assert len(results["violations"]) == 0, f"Accessibility violations found: {results['violations']}"
134-
139+
assert (
140+
len(results["violations"]) == 0
141+
), f"Accessibility violations found: {results['violations']}"
135142

136143

137144
@pytest.mark.parametrize(
@@ -148,8 +155,9 @@ def test_page_description_in_index_and_blog(page_url: tuple[Page, str], url: str
148155
axe = Axe()
149156
results = axe.run(page)
150157

151-
assert len(results["violations"]) == 0, f"Accessibility violations found: {results['violations']}"
152-
158+
assert (
159+
len(results["violations"]) == 0
160+
), f"Accessibility violations found: {results['violations']}"
153161

154162

155163
def stem_description(
@@ -186,5 +194,6 @@ def test_page_blog_posts(
186194
axe = Axe()
187195
results = axe.run(page)
188196

189-
assert len(results["violations"]) == 0, f"Accessibility violations found: {results['violations']}"
190-
197+
assert (
198+
len(results["violations"]) == 0
199+
), f"Accessibility violations found: {results['violations']}"

0 commit comments

Comments
 (0)