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

Postpone environment evaluation #30

Merged
merged 10 commits into from
Apr 11, 2024
Merged

Postpone environment evaluation #30

merged 10 commits into from
Apr 11, 2024

Conversation

alecandido
Copy link
Member

At the moment, I shifted this to the Client() instantiation.

It could be better to pass down the callable, and only retrieve the URL during the request.
I didn't do it, because there might be a point in having a consistent Client, during its whole lifetime (though I'm not sure...).

Closes #29

@alecandido
Copy link
Member Author

Btw, you're mixing unittest and pytest, that are two separate testing frameworks.

from unittest.mock import Mock, patch

(and Pytest is the runner).

I'd suggest using https://docs.pytest.org/en/latest/how-to/monkeypatch.html

Copy link

codecov bot commented Mar 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e56ba17) to head (1d25cb5).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #30   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          121       125    +4     
=========================================
+ Hits           121       125    +4     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@scarrazza scarrazza left a comment

Choose a reason for hiding this comment

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

This is fine by me, even though from a practical perspective it is very unlikely that we will need this feature when we will have a stable setup.

@alecandido
Copy link
Member Author

This is fine by me, even though from a practical perspective it is very unlikely that we will need this feature when we will have a stable setup.

Hopefully true, but it could happen that someone wants to patch the port after import (that almost always happens top-level). True that, since the port is fixed server-side, there should be no reason to patch the provider. But it is also useful as a blueprint for other ones (and it should not be harmful).

@marcorossi5 marcorossi5 marked this pull request as ready for review April 11, 2024 07:10
@marcorossi5
Copy link
Contributor

Btw, you're mixing unittest and pytest, that are two separate testing frameworks.

from unittest.mock import Mock, patch

(and Pytest is the runner).
I'd suggest using https://docs.pytest.org/en/latest/how-to/monkeypatch.html

Let's merge for the moment and open a refactoring issue about that.

@marcorossi5 marcorossi5 merged commit 4aaf012 into main Apr 11, 2024
15 checks passed
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.

Top-level environment probe
3 participants