Hypothesis: Error on Python 3.5.1: TypeError: Bound must be a type. Got <built-in function callable>.

Created on 11 Jan 2020  路  1Comment  路  Source: HypothesisWorks/hypothesis

Using hypothesis 5.1.4 with Python 3.5.1:

Traceback (most recent call last):
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/bin/pytest", line 8, in <module>
    sys.exit(main())
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 72, in main
    config = _prepareconfig(args, plugins)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 223, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/manager.py", line 87, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/helpconfig.py", line 89, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 793, in pytest_cmdline_parse
    self.parse(args)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 999, in parse
    self._preparse(args, addopts=addopts)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 947, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/importlib_metadata/__init__.py", line 94, in load
    module = import_module(match.group('module'))
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/hypothesis/__init__.py", line 24, in <module>
    from hypothesis._settings import HealthCheck, Phase, Verbosity, settings
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/hypothesis/_settings.py", line 37, in <module>
    from hypothesis.internal.reflection import get_pretty_function_description
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/hypothesis/internal/reflection.py", line 37, in <module>
    C = TypeVar("C", bound=callable)
  File "/opt/python/3.5.1/lib/python3.5/typing.py", line 405, in __new__
    self.__bound__ = _type_check(bound, "Bound must be a type.")
  File "/opt/python/3.5.1/lib/python3.5/typing.py", line 299, in _type_check
    raise TypeError(msg + " Got %.100r." % (arg,))
TypeError: Bound must be a type. Got <built-in function callable>.

(via https://github.com/pytest-dev/pytest/pull/6440#issuecomment-573353958)

bug

Most helpful comment

Hmm, looks like we need a CI job for Python 3.5.0 :grimacing:

(note to other maintainers: technically we don't promise support for older patch versions of Python, but IMO we ought to start by fixing this and either keep it fixed or bump the python_requires to >= 3.5.2 and I prefer the former until we drop 3.5 entirely)

>All comments

Hmm, looks like we need a CI job for Python 3.5.0 :grimacing:

(note to other maintainers: technically we don't promise support for older patch versions of Python, but IMO we ought to start by fixing this and either keep it fixed or bump the python_requires to >= 3.5.2 and I prefer the former until we drop 3.5 entirely)

Was this page helpful?
0 / 5 - 0 ratings