Commit d1d41fd3 authored by Jeff Hwang's avatar Jeff Hwang Committed by Facebook GitHub Bot
Browse files

Add default use_tmp_hub_dir value for integration tests (#3558)

Summary:
Pull Request resolved: https://github.com/pytorch/audio/pull/3558

In the event that `use_tmp_hub_dir` isn't specified as an option, pytest shouldn't fail. To resolve such failures, this PR modifies function `temp_hub_dir` to fall back on a default value of `False` for `use_tmp_hub_dir`.

Reviewed By: mthrok

Differential Revision: D48318947

fbshipit-source-id: 5dd692f9202ef37ec3e2c9ea39896156f928d693
parent 9467fc44
...@@ -102,7 +102,7 @@ def pytest_addoption(parser): ...@@ -102,7 +102,7 @@ def pytest_addoption(parser):
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def temp_hub_dir(tmp_path, pytestconfig): def temp_hub_dir(tmp_path, pytestconfig):
if not pytestconfig.getoption("use_tmp_hub_dir"): if not pytestconfig.getoption("use_tmp_hub_dir", default=False):
yield yield
else: else:
org_dir = torch.hub.get_dir() org_dir = torch.hub.get_dir()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment