Skip to content

Commit

Permalink
Merge pull request #2168 from Zalathar/python-werror-failure
Browse files Browse the repository at this point in the history
Explain why launching "python -Werror" might mysteriously fail
  • Loading branch information
Zac-HD committed Nov 1, 2019
2 parents e80501c + 0c56504 commit 3149548
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion guides/testing-hypothesis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The following will give you a working virtualenv for running tests in:
pip install -e .
# Test specific dependencies.
pip install pytest-xdist flaky mock
pip install pytest-xdist flaky mock pexpect
Now whenever you want to run tests you can just activate the virtualenv
using ``source testing-venv/bin/activate`` or ``testing-venv\Scripts\activate``
Expand Down
4 changes: 4 additions & 0 deletions hypothesis-python/tests/cover/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def test_non_interactive_example_emits_warning():
@pytest.mark.skipif(WINDOWS, reason="pexpect.spawn not supported on Windows")
def test_interactive_example_does_not_emit_warning():
child = pexpect.spawn("%s -Werror" % (sys.executable,))
# If this test mysteriously fails here, it might be that your python
# can't launch cleanly with "-Werror". If you are running tests manually
# from a virtualenv, you might need to update your copy of virtualenv
# and create a fresh environment.
child.expect(">>> ", timeout=1)
child.sendline("from hypothesis.strategies import none")
child.sendline("none().example()")
Expand Down

0 comments on commit 3149548

Please sign in to comment.