Skip to content

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented May 11, 2019

Fixes #5228.

(not done against master to avoid conflicts)

@blueyed
Copy link
Contributor Author

blueyed commented May 11, 2019

Fixed the non-related test in #5245.

@blueyed blueyed changed the title pdb: fix usage in child thread after main thread exited WIP/RFC pdb: fix usage in child thread after main thread exited May 11, 2019
pytestPDB._saved.append(
(pdb.set_trace, pytestPDB._pluginmanager, pytestPDB._config, pytestPDB._pdb_cls)
)
pytestPDB._saved.append(pdb.set_trace)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little worried about this because this leaves config and pluginmanager alive after pytest.main(), which might be a problem for someone embedding pytest I guess.

I wonder if we can only pass what is is actually needed to pytestPDB instead of the entire config and pluginmanager objects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the main point here is to keep them alive after pytest exits, isn't it?.. ;)

(The whole wrapping can be improved in general - I'm doing this basically step by step when running into issues)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the main point here is to keep them alive after pytest exits, isn't it?.. ;)

Yep, and I'm not sure that's a good thing 😅, specially if I'm not using threads at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative would be to fix the debugging plugin to not crash in this case I think.

@pytest-dev pytest-dev deleted a comment from codecov bot Oct 27, 2019
blueyed added a commit to blueyed/pytest that referenced this pull request Oct 27, 2019
@blueyed blueyed closed this Oct 27, 2019
@blueyed blueyed deleted the pdb-thread branch October 27, 2019 11:03
blueyed added a commit to blueyed/pytest that referenced this pull request Oct 27, 2019
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

Successfully merging this pull request may close these issues.

2 participants