-
Notifications
You must be signed in to change notification settings - Fork 3
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
TST/REF: unify and parametrize data, backend, and client fixtures #116
base: master
Are you sure you want to change the base?
Conversation
…along with setup_test_stack decorator for configuring all at once
This diff count looks crazy but it's mostly that I moved a huge function to another file 😅 |
…x of tests, given lists of test parameters
…ect children of the Root
@@ -139,8 +141,8 @@ def test_page_smoke(page: str, request: pytest.FixtureRequest): | |||
print(type(request.getfixturevalue(page))) | |||
|
|||
|
|||
@pytest.mark.parametrize("filestore_backend", ["db/filestore.json"], indirect=True) | |||
def test_apply_filter(search_page: SearchPage): | |||
@setup_test_stack(sources=["db/filestore.json"], backend_type=FilestoreBackend) |
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 appreciate how readable these ended up being
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 don't think my end-of-day review on holiday brain was thorough enough to click approve but I'm on board
I can return tomorrow and bring a real brain
No rush, I want Devan's input too, and we may have another lively discussion or two about it |
In that case, I'll coast through to eoy and look in the next |
Description
Adds
test_data
,test_backend
, andtest_client
fixtures that can be parametrized, replacing other specialized fixtures that setup specific combinations of daa / backend / clientAdds
setup_test_stack
to concisely parametrize and request the aforementionedtest_*
fixturesOrganizes data-helper functions into a separate file (for my poor scrolling finger)
Adjusts existing tests to use
setup_test_stack
andtest_*
fixtures instead of other specialized fixturesFixes bug where TestBackend could not delete an entry that was a direct child of the
Root
Fixes behavior of FilestoreBackend to throw
Entry*Error
exceptions rather than just returning NoneMotivation and Context
This is the natural evolution of Devan's
filestore_backend
parametrization efforts (#104) . I know I deleted it but its spirit lives on.This helps us avoid lots of fixtures that hold a very specific combination of test data, backend type, and client features.
How Has This Been Tested?
By seeing that the test suite still passes
Where Has This Been Documented?
This PR, and overly verbose docstrings
Pre-merge checklist
docs/pre-release-notes.sh
and created a pre-release documentation page