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

Module level code causes unexpected behavior during imports #372

Open
jessebrennan opened this issue Nov 9, 2021 · 0 comments
Open

Module level code causes unexpected behavior during imports #372

jessebrennan opened this issue Nov 9, 2021 · 0 comments

Comments

@jessebrennan
Copy link
Contributor

This pattern occurs when importing fixtures.populate_workspace_data and tests.config.

Fortunately these are both internal and just for testing, but running code at import time is generally a bad practice.

The behavior certainly surprised be in this instance.

For example, I was experimenting and ran:

Python 3.8.3 (default, Feb 16 2021, 18:46:06) 
[GCC 10.2.0] on linux
>>> from tests.infra import SuppressWarningsMixin
2021-11-09 01:14:59::WARNING  Unable to determine/refresh application credentials
Go to the following link in your browser:
Enter verification code:     https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=vy4tbIBoZTISL2hQcBLHex3vliDhx4&prompt=consent&access_type=offline&code_challenge=QjAPb1mvdpWqWWI8dieFpVlJGxZd-AnUuuYvHdh9Tmg&code_challenge_method=S256

which took a long time and finally prompted me for a verification code.

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

No branches or pull requests

1 participant