From 7c84341e7ad2b9bb73eea85fe02ec155ef575128 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 5 Jun 2025 12:44:56 -0700 Subject: unittests: use UnitTest helper methods instead of raw assert Which doesn't give helpful error messages unless used with pytest --- unittests/optiontests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unittests/optiontests.py b/unittests/optiontests.py index 5758a2d5c..ee84f9582 100644 --- a/unittests/optiontests.py +++ b/unittests/optiontests.py @@ -221,8 +221,8 @@ class OptionTests(unittest.TestCase): def test_b_nonexistent(self): optstore = OptionStore(False) - assert optstore.accept_as_pending_option(OptionKey('b_ndebug')) - assert not optstore.accept_as_pending_option(OptionKey('b_whatever')) + self.assertTrue(optstore.accept_as_pending_option(OptionKey('b_ndebug'))) + self.assertFalse(optstore.accept_as_pending_option(OptionKey('b_whatever'))) def test_reconfigure_b_nonexistent(self): optstore = OptionStore(False) @@ -231,8 +231,8 @@ class OptionTests(unittest.TestCase): def test_subproject_nonexistent(self): optstore = OptionStore(False) subprojects = {'found'} - assert not optstore.accept_as_pending_option(OptionKey('foo', subproject='found'), subprojects) - assert optstore.accept_as_pending_option(OptionKey('foo', subproject='whatisthis'), subprojects) + self.assertFalse(optstore.accept_as_pending_option(OptionKey('foo', subproject='found'), subprojects)) + self.assertTrue(optstore.accept_as_pending_option(OptionKey('foo', subproject='whatisthis'), subprojects)) def test_deprecated_nonstring_value(self): # TODO: add a lot more deprecated option tests -- cgit v1.2.3