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

add test examples to docs #14

Merged
merged 1 commit into from
Nov 9, 2024
Merged

add test examples to docs #14

merged 1 commit into from
Nov 9, 2024

Conversation

davidism
Copy link
Member

@davidism davidism commented Nov 9, 2024

Finished up the missing section, closes #6. Also address some notes from @pamelafox.

  • Show an example of using the app context, call out that it shouldn't be pushed around requests.
  • Show an example of an app context fixture and using it with pytest.mark.usefixtures for tests that don't make requests.
  • Explain how the test_config argument to the app factory works, and point out that it's used in the app fixture.
  • Clarify that the same db extension instance is imported in code and tests.

The one comment not addressed was where to define BaseModel. That's because it shouldn't matter. It's shown being defined in a models.py file in the getting started docs. But really, it and other models can be defined wherever, as long as they're importable. It's the same as any other code in the application.

@davidism davidism merged commit afe77ff into main Nov 9, 2024
2 checks passed
@davidism davidism deleted the test-docs branch November 9, 2024 17:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Testing docs cuts off mid-sentence
1 participant