pylint-dev / pylint-dev/astroid

[BUG] Cannot import Astroid with schemathesis 3.19.6

Open
#2,191 4 comments 0 reactions 0 assignees View on GitHub
Bug 🪳 Needs PR
Dominant language
Python
Stars
582
Forks
357
Avg merge
1d 1h
Merged PRs (30d)
23

Description

**Describe the bug**
When I start a pytest session the astroid package enters an infinite loop when it is imported.

**To Reproduce**
I prepared a [pipenv file](https://gist.github.com/kain88-de/be901c0962fa9b67a47dd8b5cd790ac2) that creates an environment to reproduce the issues.

Once you downloaded all files run

1. `make .venv`
2. `run-pipenv run python -m pytest t.py --pdb`

This will drop you in a debugger session at the place where astroid is stuck in a loop. With version 3.19.0 everything still works.

**Expected behavior**

Adding schemathesis as a dependency has no impact if I can import astroid in a pytest environment or not.

**Environment (please complete the following information):**

- OS: linux
- Python: 3.11

**Additional context**
I'm not sure what the root cause is so I will also open tickets for this with [pytest](https://github.com/pytest-dev/pytest/issues/11053) and [schemathesis](https://github.com/schemathesis/schemathesis/issues/1745)

Contributor guide

No contributing guide indexed for this repository

Research direction

Use the linked pipenv file to recreate the environment, then run `make .venv` followed by `run-pipenv run python -m pytest t.py --pdb`. Start in the debugger where astroid is stuck in the import loop, and compare the environment with schemathesis 3.19.6 versus 3.19.0. Done means astroid can be imported during a pytest session without the loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.