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

test_download_model doesn't test anything? #22

Closed
pmeier opened this issue Oct 3, 2021 · 1 comment
Closed

test_download_model doesn't test anything? #22

pmeier opened this issue Oct 3, 2021 · 1 comment

Comments

@pmeier
Copy link

pmeier commented Oct 3, 2021

The test simply calls load_pretrained twice, but doesn't do anything with the results:

def test_load_model(tmp_path: Path):
"""Test downloading formation energies model."""
orig_model = load_pretrained("binary_e_form", save_dir=tmp_path)
reload_model = load_pretrained("binary_e_form", save_dir=tmp_path)
def test_load_data(tmp_path: Path):

@a-ws-m
Copy link
Owner

a-ws-m commented Oct 14, 2021

I've used pytest-mock to implement an actual test here now. Originally, I was just checking the commands executed without raising any errors, but it makes sense to more rigorously check that the first function call downloads the data and the second one reloads it from disk.

@pmeier pmeier closed this as completed Oct 15, 2021
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

2 participants