Skip to content

Commit

Permalink
Shorten error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dc-almeida committed Nov 13, 2024
1 parent e570fff commit 9a74fbc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nomenclature/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, path, dimensions=None):
or [x.stem for x in path.iterdir() if x.is_dir()]
)
if not self.dimensions:
raise ValueError("No dimensions specified in data structure.")
raise ValueError("No dimensions specified.")

for dim in self.dimensions:
codelist_cls = SPECIAL_CODELIST.get(dim, CodeList)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def test_cli_empty_definitions_dir():

assert cli_result.exit_code == 1
assert isinstance(cli_result.exception, ValueError)
assert "No dimensions specified in data structure." in str(cli_result.exception)
assert "No dimensions specified." in str(cli_result.exception)


def test_check_region_aggregation(tmp_path):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_nonexisting_path_raises():

def test_empty_codelist_raises():
"""Check that initializing a DataStructureDefinition with empty CodeList raises"""
match = "No dimensions specified in data structure."
match = "No dimensions specified."
with pytest.raises(ValueError, match=match):
DataStructureDefinition(TEST_DATA_DIR / "codelist" / "simple_codelist")

Expand Down

0 comments on commit 9a74fbc

Please sign in to comment.