From e62a617305d119d73307c87512aff57d7e439d64 Mon Sep 17 00:00:00 2001 From: Joseph Capriotti Date: Fri, 16 Aug 2024 15:02:41 -0600 Subject: [PATCH] add to test-data unittests --- test-data/unit/stubgen.test | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/test-data/unit/stubgen.test b/test-data/unit/stubgen.test index b5128d9d8cfa..5ec7fdcb6fe2 100644 --- a/test-data/unit/stubgen.test +++ b/test-data/unit/stubgen.test @@ -3641,6 +3641,58 @@ class B: def quoteD() -> None: '''raw with quotes\\"''' +[case testIncludeDocstringsInspectMode] +# flags: --include-docstrings --inspect-mode +class A: + """class docstring + + a multiline 😊 docstring""" + def func(): + """func docstring + don't forget to indent""" + ... + def nodoc(): + ... +class B: + def quoteA(): + '''func docstring with quotes"""\\n + and an end quote\'''' + ... + def quoteB(): + '''func docstring with quotes""" + \'\'\' + and an end quote\\"''' + ... + def quoteC(): + """func docstring with end quote\\\"""" + ... + def quoteD(): + r'''raw with quotes\"''' + ... +[out] +class A: + """class docstring + + a multiline 😊 docstring""" + def func() -> None: + """func docstring + don't forget to indent""" + def nodoc() -> None: ... + +class B: + def quoteA() -> None: + '''func docstring with quotes"""\\n + and an end quote\'''' + def quoteB() -> None: + '''func docstring with quotes""" + \'\'\' + and an end quote\\"''' + def quoteC() -> None: + '''func docstring with end quote\\"''' + def quoteD() -> None: + '''raw with quotes\\"''' + + [case testIgnoreDocstrings] class A: """class docstring