Skip to content

plugin: Set unused_tcp_port_factory scope to 'session'#163

Merged
Tinche merged 1 commit intopytest-dev:masterfrom
romainletendart:master
Dec 1, 2020
Merged

plugin: Set unused_tcp_port_factory scope to 'session'#163
Tinche merged 1 commit intopytest-dev:masterfrom
romainletendart:master

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

3 participants