diff --git a/pytest/validate.py b/pytest/validate.py index 51f8b964..bbdfa7b5 100644 --- a/pytest/validate.py +++ b/pytest/validate.py @@ -6,16 +6,18 @@ import difflib import subprocess import tempfile import functools -# compatability -import six # uncompyle6 / xdis -from uncompyle6 import PYTHON_VERSION, IS_PYPY, deparse_code +from uncompyle6 import PYTHON_VERSION, PYTHON3, IS_PYPY, deparse_code # TODO : I think we can get xdis to support the dis api (python 3 version) by doing something like this there from xdis.bytecode import Bytecode from xdis.main import get_opcode opc = get_opcode(PYTHON_VERSION, IS_PYPY) Bytecode = functools.partial(Bytecode, opc=opc) +if PYTHON3: + from io import StringIO +else: + from StringIO import StringIO def _dis_to_text(co): return Bytecode(co).dis() diff --git a/requirements.txt b/requirements.txt index f1629154..5b1e7b65 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ # Pick up stuff from setup.py +hypothesis==2.0.0 +pytest -e .