Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and change a11y tests #1687

Merged
merged 3 commits into from
Feb 12, 2024
Merged

Fix and change a11y tests #1687

merged 3 commits into from
Feb 12, 2024

Conversation

gabalafou
Copy link
Collaborator

@gabalafou gabalafou commented Jan 29, 2024

Some of the passing accessibility tests broke because of the way I had implemented the data regression fixtures for pytest-regressions in #1501.

Specifically, some of the data regression fixture files contained the Axe-core version, so when Axe-core was updated, those fixtures became out of sync with the test run.

I decided to scrap the data regression fixture files and instead, I define a function in the test file that filters out violations for Axe-core rules that we want to ignore. Using a function is ultimately more flexible.

@gabalafou
Copy link
Collaborator Author

cc @trallard

@trallard trallard added the tag: accessibility Issues related to accessibility issues or efforts label Jan 31, 2024
@trallard trallard added the tag: testing Issues related to PST testing label Feb 12, 2024
Copy link
Collaborator

@trallard trallard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added only a minor comment, but this LGMT plus this approach seems a lot more maintainable than the previous one so this is a +1

Will go ahead and approve and wait a day or so before merging to allow for any other comments

tests/test_a11y.py Outdated Show resolved Hide resolved
tests/test_a11y.py Show resolved Hide resolved
Copy link
Collaborator

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a nice improvement, thanks @gabalafou!

Long-term, I might consider splitting out the mapping of pagename -> expected/tolerated violation into a dict or other data structure that is external to the function, or maybe even storing it as a separate JSON or YAML file. I usually find that easier to maintain than the current design, where the various exceptional url_pathnames are written into the function code body.

That said, the landmark-unique situation is complicated and might not be easy to abstract out in the way I've just described. So I think for now let's go with what you've got here.

drammock and others added 2 commits February 12, 2024 15:46
Co-authored-by: Tania Allard <taniar.allard@gmail.com>
@drammock drammock merged commit 355d612 into pydata:main Feb 12, 2024
18 checks passed
ivanov pushed a commit to ivanov/pydata-sphinx-theme that referenced this pull request Jun 5, 2024
* Fix and change a11y tests

* Apply suggestions from code review

Co-authored-by: Tania Allard <taniar.allard@gmail.com>

* fix lint

---------

Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Tania Allard <taniar.allard@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: accessibility Issues related to accessibility issues or efforts tag: testing Issues related to PST testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants