Skip to content

Commit

Permalink
[red-knot] document test framework (#13695)
Browse files Browse the repository at this point in the history
This adds documentation for the new test framework.

I also added documentation for the planned design of features we haven't
built yet (clearly marked as such), so that this doc can become the sole
source of truth for the test framework design (we don't need to refer
back to the original internal design document.)

Also fixes a few issues in the test framework implementation that were
discovered in writing up the docs.

---------

Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
  • Loading branch information
4 people authored Oct 10, 2024
1 parent d6b24b6 commit a3dc5c0
Show file tree
Hide file tree
Showing 5 changed files with 598 additions and 77 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ repos:
additional_dependencies:
- mdformat-mkdocs
- mdformat-admon
- mdformat-footnote
exclude: |
(?x)^(
docs/formatter/black\.md
Expand Down
4 changes: 4 additions & 0 deletions crates/red_knot_python_semantic/resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Markdown files within the `mdtest/` subdirectory are tests of type inference and type checking;
executed by the `tests/mdtest.rs` integration test.

See `crates/red_knot_test/README.md` for documentation of this test format.
1 change: 1 addition & 0 deletions crates/red_knot_python_semantic/tests/mdtest.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use red_knot_test::run;
use std::path::PathBuf;

/// See `crates/red_knot_test/README.md` for documentation on these tests.
#[rstest::rstest]
fn mdtest(#[files("resources/mdtest/**/*.md")] path: PathBuf) {
let crate_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
Expand Down
Loading

0 comments on commit a3dc5c0

Please sign in to comment.