Skip to content
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

tests incompatible with hypothesis 4 #53

Closed
carlwgeorge opened this issue Apr 6, 2019 · 1 comment
Closed

tests incompatible with hypothesis 4 #53

carlwgeorge opened this issue Apr 6, 2019 · 1 comment

Comments

@carlwgeorge
Copy link

  • PrettyPrinter version: 0.17.0
  • Python version: 3.7.3
  • Operating System: Fedora 30

Description

requirements_dev.txt pins hypothesis at 3.33.0, but the latest version on PyPI is 4.14.5. I upgraded hypothesis and tried to run the tests again, but they failed. In hypothesis 4.0.0 the average_size argument was removed, which I think is what is causing the failure.

What I Did

$ pip install -U hypothesis
$ pytest -v
output (click to expand)
========================================================= test session starts ==========================================================
platform linux -- Python 3.7.3, pytest-4.3.0, py-1.8.0, pluggy-0.9.0 -- /root/prettyprinter-0.17.0/.env/bin/python3
cachedir: .pytest_cache
Django settings: prettyprinter_testproject.settings (from ini file)
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/root/prettyprinter-0.17.0/.hypothesis/examples')
rootdir: /root/prettyprinter-0.17.0, inifile: setup.cfg
plugins: pythonpath-0.7.3, django-3.4.7, hypothesis-4.14.5
collected 54 items / 1 errors / 53 selected                                                                                            

================================================================ ERRORS ================================================================
_____________________________________________ ERROR collecting tests/test_prettyprinter.py _____________________________________________
tests/test_prettyprinter.py:246: in <module>
    primitives() | primitives().map(type)
tests/test_prettyprinter.py:234: in containers
    return st.recursive(primitives, extend, max_leaves=50)
.env/lib64/python3.7/site-packages/hypothesis/_strategies.py:1653: in recursive
    return RecursiveStrategy(base, extend, max_leaves)
.env/lib64/python3.7/site-packages/hypothesis/searchstrategy/recursive.py:67: in __init__
    strategies = [self.limited_base, self.extend(self.limited_base)]
tests/test_prettyprinter.py:224: in extend
    st.lists(base, average_size=10, max_size=50),
E   TypeError: lists() got an unexpected keyword argument 'average_size'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================= 1 error in 0.65 seconds ========================================================
@tommikaikkonen
Copy link
Owner

Fixed in #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants