Skip to content

Commit 326457d

Browse files
committed
(minor) Update hypothesis versions, insert needed newline in docs
1 parent 239816d commit 326457d

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Christopher Gateley
55
Jack Miller
66
Morgan Goose
77
Nick Fitzgerald
8+
Zach Smith
89
goosemo
910
khamidou

pycco/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def parse(code, language):
6464
Given a string of source code, parse out each comment and the code that
6565
follows it, and create an individual **section** for it.
6666
Sections take the form:
67+
6768
{ "docs_text": ...,
6869
"docs_html": ...,
6970
"code_text": ...,
@@ -252,6 +253,8 @@ def highlight(sections, language, preserve_paths=True, outdir=None):
252253
outdir=outdir))
253254
section["num"] = i
254255

256+
return sections
257+
255258
# === HTML Code generation ===
256259

257260

requirements.test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
hypothesis==1.14.0
1+
hypothesis==1.18.1
22
pytest-cov==2.2.0
33
coveralls==1.1

tests/test_pycco.py

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,6 @@ def test_ensure_directory(dir_name):
108108
p.ensure_directory(tempdir)
109109
assert os.path.isdir(safe_name)
110110

111-
# The following functions get good test coverage, but effort should be put into
112-
# decomposing the functions they test and actually testing their output.
113-
114-
115-
def test_generate_documentation():
116-
p.generate_documentation(PYCCO_SOURCE, outdir=tempfile.gettempdir())
117-
118-
119-
@given(booleans(), choices())
120-
def test_process(preserve_paths, choice):
121-
lang_name = choice([l["name"] for l in p.languages.values()])
122-
p.process([PYCCO_SOURCE], preserve_paths=preserve_paths, outdir=tempfile.gettempdir(), language=lang_name)
123-
124111

125112
def test_ensure_multiline_string_support():
126113
code = '''x = """
@@ -139,3 +126,26 @@ def x():
139126

140127
assert docs_code_tuple_list[0]['docs_text'] == ''
141128
assert "#" not in docs_code_tuple_list[1]['docs_text']
129+
130+
131+
def test_indented_block():
132+
133+
code = '''"""
134+
To install Pycco, simply
135+
136+
pip install pycco
137+
"""
138+
'''
139+
parsed = p.parse(code, PYTHON)
140+
highlighted = p.highlight(parsed, PYTHON, outdir=tempfile.gettempdir())
141+
print highlighted
142+
143+
144+
def test_generate_documentation():
145+
p.generate_documentation(PYCCO_SOURCE, outdir=tempfile.gettempdir())
146+
147+
148+
@given(booleans(), choices())
149+
def test_process(preserve_paths, choice):
150+
lang_name = choice([l["name"] for l in p.languages.values()])
151+
p.process([PYCCO_SOURCE], preserve_paths=preserve_paths, outdir=tempfile.gettempdir(), language=lang_name)

0 commit comments

Comments
 (0)