Add @pytest.mark.portal marker support (#37)#42
Merged
Conversation
Introduce a portal marker that lets tests declare GenericSetup profiles, content, and roles inline — without overriding the portal fixture. New session-scoped fixtures: apply_profiles, create_content, grant_roles. Also: bump Plone to 6.1.4, add plone-stubs to test deps, update mx.ini.
- actions/checkout v4 → v6, astral-sh/setup-uv v5 → v8.0.0 - Use setup-uv built-in caching instead of actions/cache - Skip venv creation in Makefile when .venv already exists (setup-uv) - Run mypy via uvx to avoid full install in lint job - Add fail-fast: false to test matrix - Fix cookiecutter template variable left in Makefile
plone-stubs is not published on PyPI, so reference it directly from GitHub. Remove it from mx.ini (no marker support) and use a PEP 508 direct reference in pyproject.toml instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@pytest.mark.portalmarker that lets tests declare GenericSetup profiles, content, and roles inline — without overriding theportalfixtureapply_profilessession-scoped fixture to apply GenericSetup profilescreate_contentsession-scoped fixture to create content items as the site ownergrant_rolessession-scoped fixture to grant local roles to the test userCloses #37
Example
Housekeeping
plone-stubsto test dependenciesTest plan
rolesparameter grant roles to the test usercontentparameter create content in the portalprofilesparameter apply GenericSetup profiles