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

Connect to network immediatly prior to running tests #819

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

iamdefinitelyahuman
Copy link
Member

What I did

When running tests, do not connect to the network until immediately before running tests.

How I did it

  • Moved network.connect from pytest_collection_modifyitems to pytest_collection_finish. The hook for pytest_collection_finish is handled as a hookwrapper so that the connection is guaranteed to happen after any user-defined plugins using the same hook point.
  • Prior to connecting, check if there is already an existing connection. This allows 3rd party plugins to handle connecting, if they desire.

How to verify it

Run some tests!

@iamdefinitelyahuman iamdefinitelyahuman merged commit 94d9f0c into master Oct 22, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the feat-pytest-network-connect branch October 22, 2020 21:51
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

1 participant