As documented in https://coverage.readthedocs.io/en/7.5.0/contexts.html#dynamic-contexts
While working on #11517 I wanted to see which test
is best to modify for the fix.
One way to easily find this out is to see which line is covered
by which test.
This PR adds a dynamic context setting
and makes them show on the HTML coverage report.
The contexts are test function names.
NOTE pytest-cov plugin has even better support
for pytest test names as coverage contexts,
but I think this PR is already an imporovement.
* 🔧 Update pre-commit, use ruff format
* ⬆️ Upgrade dependencies, use Ruff for formatting
* 🔧 Update Ruff config
* 🔨 Update lint and format scripts, use Ruff
* 🎨 Format internals with Ruff
* 🎨 Format docs scripts
* 🎨 Format tests
* 🎨 Format extra commas in src for docs
* 📝 Update docs mentioning `@lru_cache()`, use `@lru_cache` instead to keep consistency with the format
* 🎨 Update src for docs, use plain `@lru_cache`
* 🎨 Update src for docs format and docs references
* ➕ Add mkdocstrings and griffe-typingdoc to dependencies
* 🔧 Add mkdocstrings configs to MkDocs
* 📝 Add first WIP reference page
* ⬆️ Upgrade typing-extensions to the minimum version including Doc()
* 📝 Add docs to FastAPI parameters
* 📝 Add docstrings for OpenAPI docs utils
* 📝 Add docstrings for security utils
* 📝 Add docstrings for UploadFile
* 📝 Update docstrings in FastAPI class
* 📝 Add docstrings for path operation methods
* 📝 Add docstring for jsonable_encoder
* 📝 Add docstrings for exceptions
* 📝 Add docstsrings for parameter functions
* 📝 Add docstrings for responses
* 📝 Add docstrings for APIRouter
* ♻️ Sub-class BackgroundTasks to document it with docstrings
* 📝 Update usage of background tasks in dependencies
* ✅ Update tests with new deprecation warnings
* 📝 Add new reference docs
* 🔧 Update MkDocs with new reference docs
* ✅ Update pytest fixture, deprecation is raised only once
* 🎨 Update format for types in exceptions.py
* ♻️ Update annotations in BackgroundTask, `Annotated` can't take ParamSpec's P.args or P.kwargs
* ✏️ Fix typos caught by @pawamoy
* 🔧 Update and fix MkDocstrings configs from @pawamoy tips
* 📝 Update reference docs
* ✏️ Fix typos found by @pawamoy
* ➕ Add HTTPX as a dependency for docs, for the TestClient
* 🔧 Update MkDocs config, rename websockets reference
* 🔇 Add type-ignores for Doc as the stubs haven't been released for mypy
* 🔥 Remove duplicated deprecated notice
* 🔇 Remove typing error for unreleased stub in openapi/docs.py
* ✅ Add tests for UploadFile for coverage
* ⬆️ Upgrade griffe-typingdoc==0.2.2
* 📝 Refactor docs structure
* 🔨 Update README generation with new index frontmatter and style
* 🔨 Update generation of languages, remove from top menu, keep in lang menu
* 📝 Add OpenAPI Pydantic models
* 🔨 Update docs script to not translate Reference and Release Notes
* 🔧 Add reference for OpenAPI models
* 🔧 Update MkDocs config for mkdocstrings insiders
* 👷 Install mkdocstring insiders in CI for docs
* 🐛 Fix MkDocstrings insiders install URL
* ➕ Move dependencies shared by docs and tests to its own requirements file
* 👷 Update cache keys for test and docs dependencies
* 📝 Remove no longer needed __init__ placeholder docstrings
* 📝 Move docstring for APIRouter to the class level (not __init__ level)
* 🔥 Remove no longer needed dummy placeholder __init__ docstring
* 📝 Add docs for Separate OpenAPI Schemas for Input and Output
* 🔧 Add new docs page to MkDocs config
* ✨ Add separate_input_output_schemas parameter to FastAPI class
* 📝 Add source examples for separating OpenAPI schemas
* ✅ Add tests for separated OpenAPI schemas
* 📝 Add source examples for Python 3.10, 3.9, and 3.7+
* 📝 Update docs for Separate OpenAPI Schemas with new multi-version examples
* ✅ Add and update tests for different Python versions
* ✅ Add tests for corner cases with separate_input_output_schemas
* 📝 Update tutorial to use Union instead of Optional
* 🐛 Fix type annotations
* 🐛 Fix correct import in test
* 💄 Add CSS to simulate browser windows for screenshots
* ➕ Add playwright as a dev dependency to automate generating screenshots
* 🔨 Add Playwright scripts to generate screenshots for new docs
* 📝 Update docs, tweak text to match screenshots
* 🍱 Add screenshots for new docs
* ➕ Add dependencies for MkDocs Insiders
* 🙈 Add Insider's .cache to .gitignore
* 🔧 Update MkDocs configs for Insiders
* 💄 Add custom Insiders card layout, while the custom logo is provided from upstream
* 🔨 Update docs.py script to dynamically enable insiders if it's installed
* 👷 Add cache for MkDocs Material Insiders' cards
* 🔊 Add a small log to the docs CLI
* 🔊 Tweak logs, only after exporting languages
* 🐛 Fix accessing non existing env var
* 🔧 Invalidate deps cache
* 🔧 Tweak cache IDs
* 👷 Update cache for installing insiders
* 🔊 Log insiders
* 💚 Invalidate cache
* 👷 Tweak cache keys
* 👷 Trigger CI and test cache
* 🔥 Remove cache comment
* ⚡️ Optimize cache usage for first runs of docs
* 👷 Tweak cache for MkDocs Material cards
* 💚 Trigger CI to test cache
* ✨ Add MkDocs hooks to re-use all config from en, and auto-generate missing docs files form en
* 🔧 Update MkDocs config for es
* 🔧 Simplify configs for all languages
* ✨ Compute available languages from MkDocs Material for config overrides in hooks
* 🔧 Update config for MkDocs for en, to make paths compatible for other languages
* ♻️ Refactor scripts/docs.py to remove all custom logic that is now handled by the MkDocs hooks
* 🔧 Remove ta language as it's incomplete (no translations and causing errors)
* 🔥 Remove ta lang, no translations available
* 🔥 Remove dummy overrides directories, no longer needed
* ✨ Use the same missing-translation.md file contents for hooks
* ⏪️ Restore and refactor new-lang command
* 📝 Update docs for contributing with new simplified workflow for translations
* 🔊 Enable logs so that MkDocs can show its standard output on the docs.py script
* ✨ Add language selector widget
* 🔧 Update script to re-generate MkDocs configs, including langs widget
* 🔧 Update languages MkDocs configs, with lang selector widget
* 🙈 Add .gitignore files to keep overrides directories for translations to fix serving live locally during translations
* ♻️ Refactor docs scripts to handle language overrides (newsletter notification)
* 🐛 Fix Gitter notification, use development gitter room until next release
* 🔥 Remove trigger docs preview step from build-docs workflow
as it requires a more privileged token, so it's now triggered by the preview docs watcher
* 🔊 Dump context when building to allow debugging how to refactor the Gitter bot
* ➕ Add mkdocs-markdownextradata-plugin for docs
* 🔧 Update MkDocs config file(s) to include external data
* ✨ Add external links data file
* 📝 Use external data file in External Links
* ♻️ Update data files for langs
The cost is some duplication 😔, these files are updated by the script, but to be able to serve locally they have to be duplicated
* ✨ Update docs script to copy data files
* 🔥 Remove needed duplication of data files for live docs in translations
* ♻️ Remove required extra steps to test in editor
* 🎨 Format lint script
* 📝 Remove obsolete extra steps required to test in editor from docs
* 🐛 Fix coverage
* Update isort script to match changes in the new release, isort v5.0.2
* Downgrade isort to version v4.3.21
* Add an alternative flag to --recursive in isort v5.0.2
* Add isort config file
* 🚚 Import from docs_src for tests
* 🎨 Format dependencies.utils
* 🎨 Remove isort combine_as_imports, keep black profile
* 🔧 Update isort config, use pyproject.toml, Black profile
* 🔧 Update format scripts to use explicit directories to format
otherwise it would try to format venv env directories, I have several with different Python versions
* 🎨 Format NoSQL tutorial after re-sorting imports
* 🎨 Fix format for __init__.py
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
* 🐛 Fix extra support for enum with its own schema
* ✅ Fix/update test for enum with its own schema
* 🐛 Fix type declarations
* 🔧 Update format and lint scripts to support locally installed Pydantic and Starlette
* 🐛 Add temporary type ignores while enum schemas are merged