File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ def save(self, lock: bool = False) -> None:
136
136
with h5py .File (self .filename , 'w' ) as h5file :
137
137
recursively_save (h5file , '/' , self .root , self .transform )
138
138
else :
139
- print ("Filename must be set before save can be used" )
139
+ raise ValueError ("Filename must be set before save can be used" )
140
140
141
141
def save_json (self , filename : str | Path ) -> None :
142
142
"""
Original file line number Diff line number Diff line change @@ -164,9 +164,9 @@ def test_load_nonexistent_file():
164
164
instance .load ()
165
165
166
166
167
- # def test_save_without_filename(h5_instance):
168
- # with pytest.raises(ValueError):
169
- # h5_instance.save()
167
+ def test_save_without_filename (h5_instance ):
168
+ with pytest .raises (ValueError ):
169
+ h5_instance .save ()
170
170
171
171
172
172
def test_load_json_with_invalid_data (temp_json_file ):
You can’t perform that action at this time.
0 commit comments