NREL / buildstockbatch

Other
20 stars 13 forks source link

Fix test #442

Closed nweires closed 3 months ago

nweires commented 3 months ago

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

github-actions[bot] commented 3 months ago

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

Minimum allowed coverage is 33%

Generated by :monkey: cobertura-action against 1be43a950db151da6bca9c00b0c92b23766e4961

nweires commented 3 months ago

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