MCPcopy Create free account
hub / github.com/astral-sh/ruff / format_code_blocks_python_console

Function format_code_blocks_python_console

crates/ruff_markdown/src/lib.rs:564–596  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

562
563 #[test]
564 fn format_code_blocks_python_console() {
565 let code = r#"
566```pycon
567>>> print( 'hello there' )
568hello there
569>>> def foo(): pass
570>>> def bar():
571... print( 'thing1', "thing2", )
572...
573... bar()
574...
575thing1 thing2
576```
577 "#;
578 assert_snapshot!(format_code_blocks(code, None, &FormatterSettings::default()), @r#"
579
580 ```pycon
581 >>> print("hello there")
582 hello there
583 >>> def foo():
584 ... pass
585 >>> def bar():
586 ... print(
587 ... "thing1",
588 ... "thing2",
589 ... )
590 ...
591 ...
592 ... bar()
593 thing1 thing2
594 ```
595 "#);
596 }
597}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected