-
Notifications
You must be signed in to change notification settings - Fork 11
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
Parametrize test #4729
Parametrize test #4729
Conversation
We need to create two users to demonstrate that one user was filtered out. However, the `staff_area_administrator` fixture already creates a user, so we need only create one more.
It's somewhat surprising that this behavior persists, perhaps enough to warrant a comment in the test. The
This seems fine for this test. I imagine there may be other tests that want a |
"role", | ||
[ | ||
pytest.param(OutputPublisher, id="global"), | ||
pytest.param(ProjectDeveloper, id="local"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see we use 'local' as an antonym to 'global' for ProjectMembership
-based roles vs. User
-based roles in a few places. I find this wording a little tough to intuit the meaning of and wonder if "user-based" vs "project-based" might be simpler. Or "global" vs "non-global" or "project" vs "non-project". Hmm.
I'm not suggesting this needs to change here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, we do. And yup, "global" vs "non-global" makes sense; as does "project" vs "non-project". (We also implemented, but don't actually use, OrgMembership
-based roles, just to 🤯.)
We parametrize the test to demonstrate that the filter operates on global *and* local roles. Ideally, the test wouldn't depend on us knowing that `OutputPublisher` is a global role and `ProjectDeveloper` is a local role, but making it so would add (arguably unnecessary) complexity. To clarify our intent, we assign descriptive IDs to each parameter set using `pytest.param`. Co-authored-by: Mike Kelly <[email protected]>
Pedantically, we group arrange steps into a single paragraph because paragraphs are meaningful.
0e90413
to
142d4a6
Compare
I imagine so, too. Rather than updating |
We parametrize the test to demonstrate that the filter operates on global and local roles. Ideally, the test wouldn't depend on us knowing that
OutputPublisher
is a global role andProjectDeveloper
is a local role, but making it so would add (arguably unnecessary) complexity. To clarify our intent, we assign descriptive IDs to each parameter set usingpytest.param
.@KatieB5 and I parametrized the test when considering #4632. We didn't need to do so to address that issue, but running the test once for a global role and once for a local role has the benefit of documenting how we expect
UserList
to behave.