Skip to content

Commit

Permalink
Regex update in test_utils.py and error type agreement with utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
emprzy committed Nov 20, 2024
1 parent 918ebc7 commit 764c4b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flepimop/gempyor_pkg/src/gempyor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def write_df(
return df.to_csv(path, index=False)
elif path.suffix == ".parquet":
return df.to_parquet(path, index=False, engine="pyarrow")
raise ValueError(
raise NotImplementedError(
f"Invalid extension provided: '{path.suffix[1:]}'. Supported extensions are `.csv` or `.parquet`."
)

Expand Down
2 changes: 1 addition & 1 deletion flepimop/gempyor_pkg/tests/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_read_df_and_write_success(fname, extension):
("fname", "extension"), [("mobility", "csv"), ("usa-geoid-params-output", "parquet")]
)
def test_read_df_and_write_fail(fname, extension):
with pytest.raises(ValueError, match=r".*Invalid.*extension.*Must.*"):
with pytest.raises(NotImplementedError, match=r".*Supported extensions are `.csv` or `.parquet`."):
os.chdir(tmp_path)
os.makedirs("data", exist_ok=True)
os.chdir("data")
Expand Down

0 comments on commit 764c4b2

Please sign in to comment.