mktestdocs 0.2.1__py2.py3-none-any.whl → 0.2.2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mktestdocs/__init__.py CHANGED
@@ -7,7 +7,7 @@ from mktestdocs.__main__ import (
7
7
  get_codeblock_members,
8
8
  )
9
9
 
10
- __version__ = "0.2.1"
10
+ __version__ = "0.2.2"
11
11
 
12
12
  __all__ = [
13
13
  "__version__",
mktestdocs/__main__.py CHANGED
@@ -3,7 +3,6 @@ import pathlib
3
3
  import subprocess
4
4
  import textwrap
5
5
 
6
-
7
6
  _executors = {}
8
7
 
9
8
 
@@ -90,6 +89,7 @@ def grab_code_blocks(docstring, lang="python"):
90
89
  docstring: the docstring to analyse
91
90
  lang: if not None, the language that is assigned to the codeblock
92
91
  """
92
+ docstring = format_docstring(docstring)
93
93
  docstring = textwrap.dedent(docstring)
94
94
  in_block = False
95
95
  block = ""
@@ -104,6 +104,11 @@ def grab_code_blocks(docstring, lang="python"):
104
104
  block += line + "\n"
105
105
  return [c for c in codeblocks if c != ""]
106
106
 
107
+ def format_docstring(docstring):
108
+ """Formats docstring to be able to successfully go through dedent."""
109
+ if docstring[:1] != "\n":
110
+ return f"\n {docstring}"
111
+ return docstring
107
112
 
108
113
  def check_docstring(obj, lang=""):
109
114
  """
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mktestdocs
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  License-File: LICENSE
5
5
  Provides-Extra: test
6
- Requires-Dist: pytest (>=4.0.2) ; extra == 'test'
6
+ Requires-Dist: pytest >=4.0.2 ; extra == 'test'
7
7
 
@@ -0,0 +1,7 @@
1
+ mktestdocs/__init__.py,sha256=wL-m_63-2NFVKQpqKySIm7y2vfwcutnIXpgLJU4xsxw,371
2
+ mktestdocs/__main__.py,sha256=J-x8TWbSanfrbry41ApOuoZRFClvXaH0Dq3SLXpZqtw,4745
3
+ mktestdocs-0.2.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
+ mktestdocs-0.2.2.dist-info/METADATA,sha256=YdOdkMSjz5zQzR8VJIc3uEsCNUGHBZ932h38meQ-GW0,146
5
+ mktestdocs-0.2.2.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
6
+ mktestdocs-0.2.2.dist-info/top_level.txt,sha256=1XGYsQSl3FsAtilWThIet3WOJQSuzQXXn6sQA7hxlho,11
7
+ mktestdocs-0.2.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.40.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
@@ -1,7 +0,0 @@
1
- mktestdocs/__init__.py,sha256=_iVQPmcuxkjOr-bEOP4DEygx6mnG_6fP4wJBhbc2G8E,371
2
- mktestdocs/__main__.py,sha256=BO5LopXLAeKFFuKcT0KaeErUeFXt8ekjIiyrTymBG3k,4508
3
- mktestdocs-0.2.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
- mktestdocs-0.2.1.dist-info/METADATA,sha256=67xAXa_sIfpXAHDaOiKJPxRUqXQekbdMhZDqXQzL5Ec,148
5
- mktestdocs-0.2.1.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
6
- mktestdocs-0.2.1.dist-info/top_level.txt,sha256=1XGYsQSl3FsAtilWThIet3WOJQSuzQXXn6sQA7hxlho,11
7
- mktestdocs-0.2.1.dist-info/RECORD,,