HypothesisWorks / hypothesis

Hypothesis is a powerful, flexible, and easy to use library for property-based testing.
https://hypothesis.works
Other
7.53k stars 586 forks source link

UnicodeEncodeError with py.test and hypothesis. #191

Closed ckaran closed 8 years ago

ckaran commented 8 years ago

I've been getting the oddest error with hypothesis; a UnicodeEncodeError. I've copied the output at the bottom of this message, but here is the error itself: UnicodeEncodeError: 'ascii' codec can't encode character '\xa1' in position 114: ordinal not in range(128)

and so you don't have to find the platform info, etc.:

platform darwin -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
rootdir: /Users/cemkaran/Desktop, inifile: 
plugins: hypothesis-1.11.4, xdist-1.13.1

The test I'm using:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from hypothesis import given
from hypothesis import Settings
from hypothesis import Verbosity
from hypothesis.strategies import text

__docformat__ = "restructuredtext en"

##############################################################################
##############################################################################
# Minimal test that fails
##############################################################################
##############################################################################

class Test_MinPriorityQueueElement(object):
    @given(text(),
           settings=Settings(verbosity=Verbosity.verbose))
    def test_everything(self, thing):
        pass
    # End of test_everything()
# End of class Test_MinPriorityQueueElement()

##############################################################################
##############################################################################
# Main
##############################################################################
##############################################################################

if __name__ == "__main__":
    pass

The output:

Cems-Mac-Pro:Desktop cemkaran$ py.test -s test_Hypothesis.py 
========================================================================= test session starts =========================================================================
platform darwin -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
rootdir: /Users/cemkaran/Desktop, inifile: 
plugins: hypothesis-1.11.4, xdist-1.13.1
collected 1 items 

test_Hypothesis.py Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/core.py", line 547, in is_template_example
    record_repr=record_repr,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/executors/executors.py", line 25, in default_executor
    return function()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/core.py", line 365, in run
    lambda: u'Trying example: %s(%s)' % (
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/reporting.py", line 67, in report
    current_reporter()(to_text(text))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/extra/pytestplugin.py", line 31, in __call__
    print(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xa1' in position 114: ordinal not in range(128)

Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='0')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='`')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='1')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='v')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='2')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='k')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x80')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='3')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='~')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x89')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='4')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='5')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='6')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='7')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='8')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='9')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing=':')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing=';')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='<')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='=')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='>')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='?')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='@')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='A')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='B')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='C')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='D')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='E')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='F')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='G')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='H')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='I')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='J')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='K')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='L')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='M')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='N')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='O')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='P')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='Q')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='R')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='S')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='T')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='U')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='V')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='W')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='X')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='Y')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='Z')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='[')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\\')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing=']')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='^')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='_')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='a')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='b')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='c')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='d')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='e')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='f')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='g')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='h')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='i')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='j')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='l')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='m')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='n')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='o')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='p')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='q')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='r')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='s')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='t')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='u')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='w')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='x')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='y')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='z')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='{')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='|')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='}')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x7f')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x87')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x90')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x93')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x98')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x9a')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x9c')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x9e')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x9f')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\xa0')
Successfully shrunk example 92 times
F

============================================================================== FAILURES ===============================================================================
____________________________________________________________ Test_MinPriorityQueueElement.test_everything _____________________________________________________________

self = <test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing = HypothesisProvided(value=text())

    def test_everything(self, thing=not_set):
>       return f(self, thing)

.hypothesis/eval_source/hypothesis_temporary_module_e99c642d0469213e61b1d13561acef93e67e9f2a.py:5: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/core.py:577: in wrapped_test
    print_example=True
/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/executors/executors.py:25: in default_executor
    return function()
/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/core.py:361: in run
    lambda: u'Falsifying example: %s(%s)' % (
/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/reporting.py:67: in report
    current_reporter()(to_text(text))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <hypothesis.extra.pytestplugin.StoringReporter object at 0x104698048>
msg = "Falsifying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\xa1')"

    def __call__(self, msg):
        if self.config.getoption('capture', 'fd') == 'no':
>           print(msg)
E           UnicodeEncodeError: 'ascii' codec can't encode character '\xa1' in position 118: ordinal not in range(128)

/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/extra/pytestplugin.py:31: UnicodeEncodeError
----------------------------------------------------------------------------- Hypothesis ------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/core.py", line 547, in is_template_example
    record_repr=record_repr,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/executors/executors.py", line 25, in default_executor
    return function()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/core.py", line 365, in run
    lambda: u'Trying example: %s(%s)' % (
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/reporting.py", line 67, in report
    current_reporter()(to_text(text))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/hypothesis/extra/pytestplugin.py", line 31, in __call__
    print(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xa1' in position 114: ordinal not in range(128)

Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='0')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='`')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='1')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='v')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='2')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='k')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x80')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='3')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='~')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x89')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='4')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='5')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='6')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='7')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='8')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='9')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing=':')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing=';')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='<')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='=')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='>')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='?')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='@')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='A')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='B')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='C')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='D')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='E')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='F')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='G')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='H')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='I')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='J')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='K')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='L')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='M')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='N')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='O')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='P')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='Q')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='R')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='S')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='T')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='U')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='V')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='W')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='X')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='Y')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='Z')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='[')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\\')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing=']')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='^')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='_')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='a')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='b')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='c')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='d')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='e')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='f')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='g')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='h')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='i')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='j')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='l')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='m')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='n')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='o')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='p')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='q')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='r')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='s')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='t')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='u')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='w')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='x')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='y')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='z')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='{')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='|')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='}')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x7f')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x87')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x90')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x93')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x98')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x9a')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x9c')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x9e')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\x9f')
Trying example: test_everything(self=<test_Hypothesis.Test_MinPriorityQueueElement object at 0x104684e10>, thing='\xa0')
Successfully shrunk example 92 times
====================================================================== 1 failed in 0.13 seconds =======================================================================
Cems-Mac-Pro:Desktop cemkaran$ 
DRMacIver commented 8 years ago

Huh. That is an odd error.

Could you run "python -c 'import locale; print(locale.getpreferredencoding())'" and tell me what the output is? I would hypothesise (no pun intended) that for some reason you've got your default locale set to ascii and Hypothesis is trying to print out a string whose repr contains a unicode character.

DRMacIver commented 8 years ago

(I've tried your test locally and it works for me BTW, which is why I think it's something specific to your system set up)

ckaran commented 8 years ago

-----Original Message----- From: David R. MacIver [mailto:notifications@github.com] Sent: Tuesday, October 06, 2015 4:04 PM To: DRMacIver/hypothesis hypothesis@noreply.github.com Cc: Karan, Cem F CIV USARMY RDECOM ARL (US) cem.f.karan.civ@mail.mil Subject: Re: [hypothesis] UnicodeEncodeError with py.test and hypothesis. (#191)

This email was sent from a non-Department of Defense email account, and contained active links. All links are disabled, and require you to copy and paste the address to a Web browser. Please verify the identity of the sender, and confirm authenticity of all links contained within the message.

Huh. That is an odd error.

Could you run "python -c 'import locale; print(locale.getpreferredencoding())'" and tell me what the output is? I would hypothesise (no pun intended) that for some reason you've got your default locale set to ascii and Hypothesis is trying to print out a string whose repr contains a unicode character.

It returns 'UTF-8'

Thanks, Cem Karan

ckaran commented 8 years ago

(I've tried your test locally and it works for me BTW, which is why I think it's something specific to your system set up)

It very well could be. I know that there is some other weird error going on as python messes with my TTY settings (this started relatively recently). I still haven't been able to track that one down, but maybe if I can figure out what's wrong there, this will go away??? No idea, until I can figure out THAT part and fix it, I won't be able to retest it...

Thanks for looking into this for me...

Thanks, Cem Karan

DRMacIver commented 8 years ago

I actually have a fix for what I thought was your issue, as it turned out that the case of having an ascii preferred encoding did fail in exactly the same way you're seeing! But your preferred encoding being UTF-8 confuses me, and I've no idea if this will work for you or not.

ckaran commented 8 years ago

I actually have a fix for what I thought was your issue, as it turned out that the case of having an ascii preferred encoding did fail in exactly the same way you're seeing! But your preferred encoding being UTF-8 confuses me, and I've no idea if this will work for you or not.

I'm willing to give it a shot, if you want me to. It will take me 1-2 days though, I've got meetings for the rest of today and part of tomorrow.

Thanks, Cem Karan

DRMacIver commented 8 years ago

Sure. If you try against the current master the problem is probably fixed there. There should also be a release with that fix in at some point in the near future.

ckaran commented 8 years ago

Argh... I'm sorry, I lost track of this one completely. You were right, the latest version of hypothesis fixed the bug. I'm sorry I didn't get back to you sooner...