Skip to content

Commit 26e86d5

Browse files
committed
Test backup exists
1 parent e1bd06a commit 26e86d5

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

test/data/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
# and we re-ignore hpp and exe files
77
*.hpp
88
*.exe
9-
!return_one.hpp
9+
*.*bak
10+
!return_one.hpp

test/test_model.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,13 @@ def test_model_format_deprecations(self):
406406
self.assertNotIn("<-", formatted)
407407
self.assertEqual(formatted.count('('), 0)
408408

409+
shutil.copy(stan, stan + '.testbak')
410+
try:
411+
model.format(overwrite_file=True, canonicalize=True)
412+
self.assertTrue(os.path.exists(stan + '.bak'))
413+
finally:
414+
shutil.copy(stan + '.testbak', stan)
415+
409416
@pytest.mark.skipif(
410417
cmdstan_version_before(2, 29), reason='Options only available later'
411418
)

0 commit comments

Comments
 (0)