From b3b79af14cd76728740bce442efb468ff83df6dc Mon Sep 17 00:00:00 2001 From: Zach Smith Date: Thu, 19 Nov 2015 22:46:26 -0500 Subject: Factor out highlight into more functional style --- tests/test_pycco.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/test_pycco.py b/tests/test_pycco.py index 8136c03..a1d1d84 100644 --- a/tests/test_pycco.py +++ b/tests/test_pycco.py @@ -1,11 +1,10 @@ -import copy import os import tempfile import time import pytest -from hypothesis import given, example, assume -from hypothesis.strategies import lists, text, booleans, choices, none +from hypothesis import given, example +from hypothesis.strategies import text, booleans, choices, none import pycco.main as p @@ -19,16 +18,6 @@ def get_language(choice): return choice(list(p.languages.values())) -@given(lists(text()), text()) -def test_shift(fragments, default): - if fragments == []: - assert p.shift(fragments, default) == default - else: - fragments2 = copy.copy(fragments) - head = p.shift(fragments, default) - assert [head] + fragments == fragments2 - - @given(text(), booleans(), text(min_size=1)) @example("/foo", True, "0") def test_destination(filepath, preserve_paths, outdir): @@ -63,8 +52,8 @@ def test_multi_line_leading_spaces(): def test_comment_with_only_cross_ref(): source = '''# ==Link Target==\n\ndef test_link():\n """[[testing.py#link-target]]"""\n pass''' sections = p.parse(source, PYTHON) - p.highlight(sections, PYTHON, outdir=tempfile.gettempdir()) - assert sections[1]['docs_html'] == '

testing.py

' + highlighted = p.highlight(sections, PYTHON, outdir=tempfile.gettempdir()) + assert highlighted[1]['docs_html'] == '

testing.py

' @given(text(), text()) -- cgit v1.2.1