ruff
b01a651e - [red-knot] Support for TOML configs in Markdown tests (#14785)

Commit
302 days ago
[red-knot] Support for TOML configs in Markdown tests (#14785) ## Summary This adds support for specifying the target Python version from a Markdown test. It is a somewhat limited ad-hoc solution, but designed to be future-compatible. TOML blocks can be added to arbitrary sections in the Markdown block. They have the following format: ````markdown ```toml [tool.knot.environment] target-version = "3.13" ``` ```` So far, there is nothing else that can be configured, but it should be straightforward to extend this to things like a custom typeshed path. This is in preparation for the statically-known branches feature where we are going to have to specify the target version for lots of tests. ## Test Plan - New Markdown test that fails without the explicitly specified `target-version`. - Manually tested various error paths when specifying a wrong `target-version` field. - Made sure that running tests is as fast as before.
Author
Parents
Loading