Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
elad-c committed Jan 27, 2025
1 parent 7d1b65a commit 9b873ba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/common_tests/function_tests/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,14 @@ def test_debug(self, mock_get_logger):
def test_info(self, mock_get_logger):
logger_mock = MagicMock()
mock_get_logger.return_value = logger_mock
with patch('sys.stdout', new=StringIO()) as fake_out:
Logger.info(self.log_message)
self.assertEqual(fake_out.getvalue().strip(), self.log_message)
Logger.info(self.log_message)
logger_mock.info.assert_called_once_with(self.log_message)

@patch('model_compression_toolkit.logger.Logger.get_logger')
def test_warning(self, mock_get_logger):
logger_mock = MagicMock()
mock_get_logger.return_value = logger_mock
with patch('sys.stdout', new=StringIO()) as fake_out:
Logger.warning(self.log_message)
self.assertEqual(fake_out.getvalue().strip(), self.log_message)
Logger.warning(self.log_message)
logger_mock.warning.assert_called_once_with(self.log_message)

@patch('model_compression_toolkit.logger.Logger.get_logger')
Expand Down

0 comments on commit 9b873ba

Please sign in to comment.