Skip to content

Commit 0fd924d

Browse files
pre-commit-ci[bot]GeigerJ2
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4f305b0 commit 0fd924d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/tools/archive/test_simple.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def crashing_filter(_):
157157
create_archive([struct], test_run=True, forbidden_licenses=crashing_filter)
158158

159159

160-
@pytest.mark.usefixtures("aiida_profile_clean")
160+
@pytest.mark.usefixtures('aiida_profile_clean')
161161
def test_tmp_dir_custom_valid(tmp_path):
162162
"""Test using a custom valid temporary directory."""
163163
from unittest.mock import patch
@@ -180,24 +180,26 @@ def test_tmp_dir_custom_valid(tmp_path):
180180
# Check that TemporaryDirectory was called with custom directory
181181
mock_temp_dir.assert_called_once_with(dir=custom_tmp, prefix=None)
182182

183-
@pytest.mark.usefixtures("aiida_profile_clean")
183+
184+
@pytest.mark.usefixtures('aiida_profile_clean')
184185
def test_tmp_dir_validation_errors(tmp_path):
185186
"""Test tmp_dir validation errors."""
186187

187188
node = orm.Int(42).store()
188189
filename = tmp_path / 'export.aiida'
189190

190191
# Non-existent directory
191-
with pytest.raises(ArchiveExportError, match="does not exist"):
192+
with pytest.raises(ArchiveExportError, match='does not exist'):
192193
create_archive([node], filename=filename, tmp_dir=tmp_path / 'nonexistent')
193194

194195
# File instead of directory
195196
not_a_dir = tmp_path / 'file.txt'
196197
not_a_dir.write_text('content')
197-
with pytest.raises(ArchiveExportError, match="is not a directory"):
198+
with pytest.raises(ArchiveExportError, match='is not a directory'):
198199
create_archive([node], filename=filename, tmp_dir=not_a_dir)
199200

200-
@pytest.mark.usefixtures("aiida_profile_clean")
201+
202+
@pytest.mark.usefixtures('aiida_profile_clean')
201203
def test_tmp_dir_disk_space_error(tmp_path):
202204
"""Test disk space error handling."""
203205
from unittest.mock import patch
@@ -208,10 +210,10 @@ def test_tmp_dir_disk_space_error(tmp_path):
208210
filename = tmp_path / 'export.aiida'
209211

210212
def mock_temp_dir_error(*args, **kwargs):
211-
error = OSError("No space left on device")
213+
error = OSError('No space left on device')
212214
error.errno = 28
213215
raise error
214216

215217
with patch('tempfile.TemporaryDirectory', side_effect=mock_temp_dir_error):
216-
with pytest.raises(ArchiveExportError, match="Insufficient disk space.*--tmp-dir"):
218+
with pytest.raises(ArchiveExportError, match='Insufficient disk space.*--tmp-dir'):
217219
create_archive([node], filename=filename, tmp_dir=custom_tmp)

0 commit comments

Comments
 (0)