def test_specifying_path_open_visa_library(self, caplog): """Test handling a specified path in open_visa_library.""" with caplog.at_level(logging.DEBUG): with pytest.raises(Exception): highlevel.open_visa_library("non/existent/file") assert "Could not open VISA wrapper" in caplog.records[0].message assert "non/existent/file" in caplog.records[0].message
def test_specifying_path_open_visa_library(self): """Test handling a specified path in open_visa_library. """ with self.assertLogs(level=logging.DEBUG) as cm: with self.assertRaises(Exception) as e: highlevel.open_visa_library("non/existent/file") self.assertIn("Could not open VISA wrapper", cm.output[0]) self.assertIn("non/existent/file", cm.output[0])