@@ -138,11 +138,6 @@ def test_validate_path(self):
138138 with self .assertRaisesRegex (ValueError , 'No CmdStan directory' ):
139139 validate_cmdstan_path (path_foo )
140140
141- with self .assertRaisesRegex (
142- ValueError , ".*Are you sure this is the correct path.*"
143- ):
144- set_cmdstan_path (str (DATAFILES_PATH ))
145-
146141 folder_name = '' .join (
147142 random .choice (string .ascii_letters ) for _ in range (10 )
148143 )
@@ -153,6 +148,7 @@ def test_validate_path(self):
153148 folder = pathlib .Path (folder_name )
154149 folder .mkdir (parents = True )
155150 (folder / "makefile" ).touch ()
151+
156152 with self .assertRaisesRegex (ValueError , 'missing binaries' ):
157153 validate_cmdstan_path (str (folder .absolute ()))
158154 shutil .rmtree (folder )
@@ -216,16 +212,17 @@ def test_cmdstan_version(self):
216212 'found: "dont_need_no_mmp".'
217213 )
218214 with LogCapture () as log :
219- logging .getLogger ()
220215 cmdstan_version ()
221216 log .check_present (('cmdstanpy' , 'INFO' , expect ))
222217
223218 fake_makefile .unlink ()
224- expect = StringComparison ('.*does not contain "makefile".*' )
219+ expect = (
220+ 'CmdStan installation {} missing makefile, '
221+ 'cannot get version.' .format (fake_path )
222+ )
225223 with LogCapture () as log :
226- logging .getLogger ()
227224 cmdstan_version ()
228- log .check_present (('cmdstanpy' , 'DEBUG ' , expect ))
225+ log .check_present (('cmdstanpy' , 'INFO ' , expect ))
229226 cmdstan_path ()
230227
231228
0 commit comments