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

Add "pre setup" log entry when enabling "--show-setup" #13169

Open
ctheune opened this issue Jan 28, 2025 · 1 comment
Open

Add "pre setup" log entry when enabling "--show-setup" #13169

ctheune opened this issue Jan 28, 2025 · 1 comment
Labels
topic: fixtures anything involving fixtures directly or indirectly topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch

Comments

@ctheune
Copy link
Contributor

ctheune commented Jan 28, 2025

What's the problem this feature will solve?

I've spent a long time trying to debug a fixture that was interacting with the environment and got stuck because the subprocess was trying to read from the PTY (It spawned an SSH that accidentally asked for host key verification) and it's been really hard trying to figure out what was going on (read: 4-6hs spent debugging this). Due to further environmental restrictions (being run in a NixOS vm test environment) I also had a hard time using strace not giving me relevant output.

I started with the process being stuck in collection (but this was an IO buffering issue) and then noticed that it's likely stuck while setting up some fixture. When using --show-setup I noticed that this only reports on the success of a fixture - I would have needed to get info which fixture is currently being set up.

Describe the solution you'd like

I'd like to add more output (maybe introducing the -vvv level if this becomes too verbose for the -vv level) that shows a "PRESETUP" stage (or something similar) before calling the setup of a fixture.

This would have allowed me to more quickly pinpoint where my code is going wrong.

Alternative Solutions

I normally have pytest-timeout report those kinds of things to me, but for some reason it didn't trigger here. If it did trigger then it would have shown me the subprocess call which is stuck. We could ask the pytest-timeout authors whether they could take a look at that behaviour, too.

Additional context

I'd be happy to work on the PR if this is interesting.

@RonnyPfannschmidt RonnyPfannschmidt added type: enhancement new feature or API change, should be merged into features branch topic: reporting related to terminal output and user-facing messages and errors topic: fixtures anything involving fixtures directly or indirectly labels Jan 28, 2025
@RonnyPfannschmidt
Copy link
Member

Thanks for bringing this to attention

Getting the currently under setup fixture indicated before it's completed is most helpful the moment one thinks about any larger scoped expensive fixture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: fixtures anything involving fixtures directly or indirectly topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

2 participants