-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix tests with incorrect region-skipping code #537
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #537 +/- ##
=======================================
Coverage 92.77% 92.77%
=======================================
Files 71 71
Lines 5357 5357
=======================================
Hits 4970 4970
Misses 387 387 Continue to review full report at Codecov.
|
@@ -64,10 +75,13 @@ def boto_config(request): | |||
|
|||
@pytest.fixture(scope='session') | |||
def sagemaker_session(sagemaker_client_config, sagemaker_runtime_config, boto_config): | |||
boto_session = boto3.Session(**boto_config) if boto_config else boto3.Session(region_name=DEFAULT_REGION) | |||
boto_session = boto3.Session(**boto_config) if boto_config else boto3.Session( | |||
region_name=DEFAULT_REGION) |
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.
not in scope of this PR, but seeing this and scanning through conftest.py makes me think we should make a boto_session
fixture
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.
agree, there should be another PR for this.
parser.addoption('--sklearn-full-version', action='store', default=SKLEARN_VERSION) | ||
parser.addoption('--tf-full-version', action='store', default=TF_VERSION) | ||
|
||
|
||
def pytest_configure(config): |
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.
can this go in conftest.py
or __init__.py
instead of individual test files or is there a reason it's specific to this file?
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.
yes, it must be in this file for pytest to call it (and set the env var) at the correct time. stuff in init.py doesn't have access to the pytest config (part of the original problem).
Description of changes:
fix incorrect region-skipping code
region in test.integ.REGION diverges from sagemaker_session region in several test contexts. this made the region-skipping test marks not work correctly.
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.