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

Error collecting tests: missing 1 required positional argument: 'alphabet' #499

Open
Apteryks opened this issue Nov 29, 2024 · 2 comments
Open

Comments

@Apteryks
Copy link

Hi,

Attempting to run the test suite with pytest -vv, I see this:

============================= test session starts ==============================
platform linux -- Python 3.10.7, pytest-8.3.3, pluggy-1.5.0 -- /gnu/store/jjzbav1s0x8lqg1aal13irspwwblwdf4-python-wrapper-3.10.7/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/tmp/guix-build-python-flake8-bugbear-24.10.31.drv-0/flake8_bugbear-24.10.31/.hypothesis/examples'))
rootdir: /tmp/guix-build-python-flake8-bugbear-24.10.31.drv-0/flake8_bugbear-24.10.31
configfile: pyproject.toml
plugins: hypothesis-6.121.0
collecting ... collected 0 items / 1 error

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_bugbear.py ____________________
tests/test_bugbear.py:1078: in <module>
    class TestFuzz(unittest.TestCase):
tests/test_bugbear.py:1083: in TestFuzz
    @given(from_grammar().map(ast.parse))
/gnu/store/2x5zrns071bwz2w1rqjdc816ag6awspc-python-hypothesmith-0.1.9/lib/python3.10/site-packages/hypothesmith/syntactic.py:173: in from_grammar
    return GrammarStrategy(grammar, start, auto_target)
/gnu/store/2x5zrns071bwz2w1rqjdc816ag6awspc-python-hypothesmith-0.1.9/lib/python3.10/site-packages/hypothesmith/syntactic.py:81: in __init__
    super().__init__(grammar, start, explicit_strategies)
E   TypeError: LarkStrategy.__init__() missing 1 required positional argument: 'alphabet'
=============================== warnings summary ===============================
../../../gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158
../../../gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158
  /gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158: HypothesisWarning: Generating overly large repr. This is an expensive operation, and with a length of 265 kB is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.
    self.__representation = repr_call(

../../../gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158
  /gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158: HypothesisWarning: Generating overly large repr. This is an expensive operation, and with a length of 531 kB is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.
    self.__representation = repr_call(

../../../gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158
  /gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158: HypothesisWarning: Generating overly large repr. This is an expensive operation, and with a length of 797 kB is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.
    self.__representation = repr_call(

../../../gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158
../../../gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158
  /gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158: HypothesisWarning: Generating overly large repr. This is an expensive operation, and with a length of 1595 kB is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.
    self.__representation = repr_call(

../../../gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158
  /gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158: HypothesisWarning: Generating overly large repr. This is an expensive operation, and with a length of 266 kB is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.
    self.__representation = repr_call(

../../../gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158
  /gnu/store/fxbzrh50d30d0digfi61azzz0hc9j2qx-python-hypothesis-6.121.0/lib/python3.10/site-packages/hypothesis/strategies/_internal/lazy.py:158: HypothesisWarning: Generating overly large repr. This is an expensive operation, and with a length of 1861 kB is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.
    self.__representation = repr_call(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR tests/test_bugbear.py - TypeError: LarkStrategy.__init__() missing 1 required positional argument: 'alphabet'
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
========================= 8 warnings, 1 error in 2.84s =========================

I'm using Python 3.10, the 24.10.31 release of flake8-bugbear and these inputs:

Thank you!

@Apteryks
Copy link
Author

Perhaps hypothesis is too new?

@Apteryks
Copy link
Author

Ah, hypothesmith>=0.2 -- my environment doesn't meet it; it's at 0.1.9 due to >= 0.2 requiring rust-based libcst, which I haven't figured out how to build in an isolated environment (cargo wants to pull dependencies from the net).

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

1 participant