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

plugin: Set unused_tcp_port_factory scope to 'session' #163

Merged
merged 1 commit into from Dec 1, 2020

Conversation

romainletendart
Copy link

@romainletendart romainletendart commented May 18, 2020

Factories in pytest usually have a scope greater than 'function' to allow
one use the same factory within bigger scopes. Let us allow
unused_tcp_port_factory to be used throughout the same session scope.
This will allow other session-scoped factories depend on
unused_tcp_port_factory without getting a "ScopeMismatch" error.

@romainletendart
Copy link
Author

Hi @Tinche,
What do you think about this change?
I proposed it since I needed a session-scoped factory involving unused_tcp_port_factory and couldn't simply pass the latter as an argument to my factory because of the ScopeMismatch.
I foresee others might also encounter the issue one day and it's an easy one to fix.

@RemiCardona
Copy link

Hi all, this looks like a fairly straightforward change. Is there anything I can do to help get this merged?

Thanks

@Tinche
Copy link
Member

Tinche commented Nov 27, 2020

Add a CHANGELOG entry and this can go in :)

@romainletendart
Copy link
Author

@Tinche Done. :)

@Tinche
Copy link
Member

Tinche commented Nov 28, 2020

@romainletendart sweet, please include a link to the PR like previous changes and let's get this merged and released :)

Factories in pytest usually have a scope greater than 'function' to let
one use the same factory within bigger scopes. Let us allow
unused_tcp_port_factory to be used throughout the same session scope.
This will let other session-scoped factories depend on
unused_tcp_port_factory without getting a "ScopeMismatch" error.
@romainletendart
Copy link
Author

@Tinche Done. :)

@Tinche
Copy link
Member

Tinche commented Dec 1, 2020

Thanks, I will release this in the next couple of days!

@Tinche Tinche merged commit a516134 into pytest-dev:master Dec 1, 2020
@romainletendart
Copy link
Author

Hi @Tinche!
Do you have any news on an upcoming release?

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