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

Fix test #442

Closed
wants to merge 4 commits into from
Closed

Fix test #442

wants to merge 4 commits into from

Conversation

nweires
Copy link
Collaborator

@nweires nweires commented Mar 21, 2024

Fixes a broken test. (This is the cause of broken tests on other open PRs.)

Pull Request Description

Test broke after the release of a new version of pytest-mock today.

Specifically, mocked_boto3.mock_calls changed from this:

[call.resource(),
 call.resource().Bucket(),
 call.resource('s3'),
 call.resource().Bucket('test_bucket'),
 ...

to this:

[call.__eq__(<MagicMock name='sleep' id='139908864013456'>),
 call.resource(),
 call.resource().Bucket(),
 call.__eq__(None),
 call.__eq__('/tmp/tmpvg7ae1fy/output'),
 call.__eq__(<MagicMock name='get_dask_client' id='140294353031120'>),
 call.__eq__('/tmp/tmpb6yrru6k/output'),
 call.__eq__(<ContainerRuntime.LOCAL_OPENSTUDIO: 3>),
 call.resource('s3'),
 call.resource().Bucket('test_bucket'),
 ...

The call.resource().Bucket() call (from line 136) moved from index 1 to 2, which broke the assert on line 168.

This just uses the same params everywhere, so the setup calls don't have to be excluded from the checks.

Checklist

Not all may apply

  • Code changes (must work)
  • Tests exercising your feature/bug fix (check coverage report on Checks -> BuildStockBatch Tests -> Artifacts)
  • Coverage has increased or at least not decreased. Update minimum_coverage in .github/workflows/coverage.yml as necessary.
  • All other unit and integration tests passing
  • Update validation for project config yaml file changes
  • Update existing documentation
  • Run a small batch run on Kestrel/Eagle to make sure it all works if you made changes that will affect Kestrel/Eagle
  • Add to the changelog_dev.rst file and propose migration text in the pull request

Copy link

File Coverage
All files 87%
base.py 92%
exc.py 57%
hpc.py 78%
local.py 70%
postprocessing.py 85%
utils.py 92%
cloud/docker_base.py 88%
sampler/base.py 79%
sampler/downselect.py 33%
sampler/precomputed.py 93%
sampler/residential_quota.py 61%
test/shared_testing_stuff.py 85%
test/test_docker.py 33%
test/test_local.py 97%
test/test_validation.py 97%
workflow_generator/base.py 90%
workflow_generator/commercial.py 53%
workflow_generator/residential_hpxml.py 86%

Minimum allowed coverage is 33%

Generated by 🐒 cobertura-action against 1be43a9

@nweires
Copy link
Collaborator Author

nweires commented Mar 22, 2024

Never mind, they fixed the issue in pytest-mock.

@nweires nweires closed this Mar 22, 2024
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.

1 participant