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

[RFC] split up _pytest.python #10996

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

RonnyPfannschmidt
Copy link
Member

this tries to split up _pytest.python by topic

the module is quite large and that makes it a pain to refactor certain details

i want to trim bits down so its more easy to eventually turn FunctionDefinition from a gruesome hack into a part of the collection tree

the initial split is not per se targeting good locations or complete

but its a discussion starter and i intend to change details until we hit a nice split that separates code in a manageable way

@RonnyPfannschmidt RonnyPfannschmidt requested review from bluetech and a team May 13, 2023 10:36
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

I definitely like the idea. 👍

@@ -116,7 +115,6 @@
"Mark",
"MarkDecorator",
"MarkGenerator",
"Metafunc",
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentional? If so this should count as a breaking change, I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, refactoring tool mistake

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

With this refactoring, python.nodes imports from python.metafunc and vice-versa. To me this means that neither module can be understood in isolation. I am -0.5 on splitting in this state, as it doesn't really help IMO.

From my experience with pytest code all of the core is intertwined so it might be hard to pull off, but it's a good goal :)

@RonnyPfannschmidt
Copy link
Member Author

Part of my goal here is to get to a state where the interdependency is more clearly painful so that detangle in small steps gets attainable

Sometime in the future I want most collection code in nodes, and functions split such that Only function definition will import from meta func

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.

None yet

3 participants