def test_validate_basetemp_fails(tmp_path, basetemp, monkeypatch): monkeypatch.chdir(str(tmp_path)) msg = "basetemp must not be empty, the current working directory or any parent directory of it" with pytest.raises(argparse.ArgumentTypeError, match=msg): if basetemp: basetemp = tmp_path / basetemp validate_basetemp(basetemp)
def test_validate_basetemp_ok(tmp_path, basetemp, monkeypatch): monkeypatch.chdir(str(tmp_path)) validate_basetemp(tmp_path / basetemp)