Skip to content

Does pytest.el require a runtests.py? Getting max-lisp-eval-depth error. #31

@neilyio

Description

@neilyio

I'm new to using pytest and pytest.el, so bear with me. I'm using Spacemacs on Windows 10. I'm using the Python layer along with LSP.

I've spent an embarrassing amount of time now debugging why pytest.el keeps giving me one of two errors. Either:
error: "Lisp nesting exceeds ‘max-lisp-eval-depth’"
or
pytest-find-test-runner-in-dir-named: Variable binding depth exceeds max-specpdl-size

Both are caused by the same thing. The function pytest-find-runner-in-dir-named is searching for a file named "runtests" (or presumably "runtests.py"), which is set by pytest-project-names. pytest-find-runner-in-dir-named recursively searches up the directory tree for "runtests".

Annoyingly, it doesn't throw an error when it reaches the drive root C:\. It just calls itself again, getting stuck in infinite recursion which ends up generating the max-eval-depth error. It would be nice if pytest.el simply threw its own error here so users can avoid cumbersome debugging.

I realize the README mentions this, suggesting to run py.test --genscript=run-tests.py to generate a "runtests" script. However, --genscript has been deprecated for 5 years, as stated here: https://github.com/pytest-dev/pytest/issues/730. It's not even a valid command in pytest anymore.

I'm confused, and I feel like I must be missing something obvious because this is part of the Python layer in Spacemacs and pytest is the most popular testing library for the most popular language in the world. So please, go easy on me, and let me know if I can help resolve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions