-
Notifications
You must be signed in to change notification settings - Fork 6.5k
chore(gae): POC - enable support for tests on Python 3 #13242
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# pin pytest to 4.6.11 for Python2. | ||
pytest==4.6.11; python_version < '3.0' | ||
responses==0.17.0; python_version < '3.7' | ||
#pytest==4.6.11; python_version < '3.0' | ||
#responses==0.17.0; python_version < '3.7' | ||
responses==0.23.1; python_version > '3.6' | ||
|
||
responses==0.23.1 | ||
pytest==8.3.5 | ||
six==1.17.0 |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -31,11 +31,16 @@ | |||||||||||||||||||||||||||||||||||||
(testbed) | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
def pytest_ignore_collect(path, config): | ||||||||||||||||||||||||||||||||||||||
"""Skip App Engine tests in python 3 or if no SDK is available.""" | ||||||||||||||||||||||||||||||||||||||
if "appengine/standard" in str(path): | ||||||||||||||||||||||||||||||||||||||
if six.PY3: | ||||||||||||||||||||||||||||||||||||||
return True | ||||||||||||||||||||||||||||||||||||||
def pytest_ignore_collect(collection_path): | ||||||||||||||||||||||||||||||||||||||
"""Skip App Engine tests if no SDK is available.""" | ||||||||||||||||||||||||||||||||||||||
if "appengine/standard" in str(collection_path): | ||||||||||||||||||||||||||||||||||||||
if "GAE_SDK_PATH" not in os.environ: | ||||||||||||||||||||||||||||||||||||||
#test_file = os.path.basename(collection_path) | ||||||||||||||||||||||||||||||||||||||
test_file = os.path.join(collection_path.parent.name, collection_path.name) | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
if ".py" in test_file: | ||||||||||||||||||||||||||||||||||||||
print("GAE_SDK_PATH is missing! " | ||||||||||||||||||||||||||||||||||||||
f"Skipping App Engine test in {test_file}." | ||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||
return True | ||||||||||||||||||||||||||||||||||||||
Comment on lines
37
to
45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original code had a check for
Suggested change
|
||||||||||||||||||||||||||||||||||||||
return False |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pytest==8.3.5 | ||
six==1.17.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message could be improved to provide more guidance to the user. Consider suggesting how to set the
GAE_SDK_PATH
environment variable or where to find the SDK.