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

hook call controller in hook specs #361

Open
RonnyPfannschmidt opened this issue Aug 3, 2022 · 2 comments
Open

hook call controller in hook specs #361

RonnyPfannschmidt opened this issue Aug 3, 2022 · 2 comments

Comments

@RonnyPfannschmidt
Copy link
Member

currently hook specs just provide the parameters

if it was allowed to have them provide more details, this could be a win

a very initial draft is something like

python

@hookspec
def pytest_something_with_paths(call_config: HookCallConfig, path: Path | None = None, oldpath: py.path.local |None = None ) -> ...
   if path is None and old_path is None:
    rasie TypeError(...)

   return call_config.set_parameters(....)  

i'd love to bikeshed apis a bit

its also a possible replacement to #151

cc @goodboy @nicoddemus @bluetech

@nicoddemus
Copy link
Member

if it was allowed to have them provide more details, this could be a win

From the example, "more details" you mean some pre and post code that will be executed before/after the hookimpl?

@RonnyPfannschmidt
Copy link
Member Author

@nicoddemus for now i would like to allow pre actions to enable backward compatible calls,

as for post actions, i'm not sure yet how to properly model those, in particular for historic hooks or different hook callers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants