Skip to content

Update for CI #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: false
language: python
python:
- '2.7'
- '3.5'
- '3.6'
install:
- 'pip install -r requirements.txt'
- 'pip install -r requirements.test.txt'
Expand All @@ -13,8 +13,6 @@ after_success:
- coveralls
matrix:
include:
- python: 3.5
env: CODESTYLE=true
- python: 2.7
env: TOXENV=py27
install: pip install tox
Expand Down
6 changes: 3 additions & 3 deletions requirements.test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coveralls==1.3.0
hypothesis==3.56.5
coveralls==1.9.2
hypothesis==4.56.1
mock~=2.0
pytest-cov~=2.0
pytest-cov~=2.8.1
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pystache==0.5.4
Pygments==2.2.0
Pygments==2.5.2
markdown==2.6.11
18 changes: 9 additions & 9 deletions tests/test_pycco.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pycco.generate_index as generate_index
import pycco.main as p
from hypothesis import assume, example, given
from hypothesis.strategies import booleans, choices, lists, none, text
from hypothesis.strategies import booleans, lists, none, text, sampled_from, data
from pycco.languages import supported_languages

try:
Expand All @@ -26,8 +26,8 @@
FOO_FUNCTION = """def foo():\n return True"""


def get_language(choice):
return choice(list(supported_languages.values()))
def get_language(data):
return data.draw(sampled_from(list(supported_languages.values())))


@given(lists(text()), text())
Expand All @@ -49,9 +49,9 @@ def test_destination(filepath, preserve_paths, outdir):
assert dest.endswith(".html")


@given(choices(), text())
def test_parse(choice, source):
lang = get_language(choice)
@given(data(), text())
def test_parse(data, source):
lang = get_language(data)
parsed = p.parse(source, lang)
for s in parsed:
assert {"code_text", "docs_text"} == set(s.keys())
Expand Down Expand Up @@ -163,9 +163,9 @@ def test_generate_documentation():
p.generate_documentation(PYCCO_SOURCE, outdir=tempfile.gettempdir())


@given(booleans(), booleans(), choices())
def test_process(preserve_paths, index, choice):
lang_name = choice([l["name"] for l in supported_languages.values()])
@given(booleans(), booleans(), data())
def test_process(preserve_paths, index, data):
lang_name = data.draw(sampled_from([l["name"] for l in supported_languages.values()]))
p.process([PYCCO_SOURCE], preserve_paths=preserve_paths,
index=index,
outdir=tempfile.gettempdir(),
Expand Down