Skip to content

Commit

Permalink
add warning messages to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Apr 7, 2023
1 parent 888bb5d commit 7098eeb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions py/desiutil/test/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def test_version(self):
self.run_setup('setup.py', ['version'])
self.assertTrue(os.path.exists(v_file))
self.assertListEqual(mock_announce.mock_calls,
[call('Version is now 0.0.1.dev0.', level=INFO)])
[call('This functionality is deprecated and will be removed from a future version of desiutil.', level=WARN),
call('Use the command-line script desi_update_version instead.', level=WARN),
call('Version is now 0.0.1.dev0.', level=INFO)])
self.assertListEqual(mock_info.mock_calls, [call('running %s', 'version')])
with patch('distutils.cmd.Command.announce') as mock_announce:
with patch('distutils.log.info') as mock_info:
Expand All @@ -101,7 +103,9 @@ def test_version(self):
data = v.read()
self.assertEqual(data, "__version__ = '1.2.3'\n")
self.assertListEqual(mock_announce.mock_calls,
[call('Version is now 1.2.3.', level=INFO)])
[call('This functionality is deprecated and will be removed from a future version of desiutil.', level=WARN),
call('Use the command-line script desi_update_version instead.', level=WARN),
call('Version is now 1.2.3.', level=INFO)])
self.assertListEqual(mock_info.mock_calls, [call('running %s', 'version')])

os.chdir(self.original_dir)
Expand Down

0 comments on commit 7098eeb

Please sign in to comment.