MCPcopy Create free account
hub / github.com/PyCQA/isort / test_function_with_docstring

Function test_function_with_docstring

tests/unit/test_isort.py:2966–2980  ·  view source on GitHub ↗

Test to ensure isort can correctly sort imports when the first found content is a function with a docstring

()

Source from the content-addressed store, hash-verified

2964
2965
2966def test_function_with_docstring() -> None:
2967 """Test to ensure isort can correctly sort imports when the first found content is a
2968 function with a docstring
2969 """
2970 add_imports = ["from __future__ import unicode_literals"]
2971 test_input = 'def foo():\n """ Single line triple quoted doctring """\n pass\n'
2972 expected_output = (
2973 "from __future__ import unicode_literals\n"
2974 "\n"
2975 "\n"
2976 "def foo():\n"
2977 ' """ Single line triple quoted doctring """\n'
2978 " pass\n"
2979 )
2980 assert isort.code(test_input, add_imports=add_imports) == expected_output
2981
2982
2983def test_plone_style() -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected