jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/859450 )
Change subject: [tests] Rename meta test class to prevent pytest warnings ...................................................................... [tests] Rename meta test class to prevent pytest warnings Change-Id: I8db1166e6fbc24479ed4eece414f013f30d125c4 --- M tests/script_tests.py M tests/ui_tests.py M tests/date_tests.py M tests/logentries_tests.py 4 files changed, 26 insertions(+), 17 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/date_tests.py b/tests/date_tests.py index 2adae3d..edc43bd 100755 --- a/tests/date_tests.py +++ b/tests/date_tests.py @@ -13,7 +13,7 @@ from tests.aspects import MetaTestCaseClass, TestCase -class TestDateMeta(MetaTestCaseClass): +class DateTestMeta(MetaTestCaseClass): """Date test meta class.""" @@ -53,7 +53,7 @@ return super().__new__(cls, name, bases, dct) -class TestDate(TestCase, metaclass=TestDateMeta): +class TestDate(TestCase, metaclass=DateTestMeta): """Test cases for date library processed by unittest.""" diff --git a/tests/logentries_tests.py b/tests/logentries_tests.py index bbbf189..056df8d 100755 --- a/tests/logentries_tests.py +++ b/tests/logentries_tests.py @@ -132,7 +132,7 @@ self.assertEqual(logentry.logid(), logentry['logid']) -class TestLogentriesMeta(MetaTestCaseClass): +class LogentriesTestMeta(MetaTestCaseClass): """Test meta class for TestLogentries.""" @@ -157,7 +157,7 @@ return super().__new__(cls, name, bases, dct) -class TestLogentries(TestLogentriesBase, metaclass=TestLogentriesMeta): +class TestLogentries(TestLogentriesBase, metaclass=LogentriesTestMeta): """Test general LogEntry properties.""" diff --git a/tests/script_tests.py b/tests/script_tests.py index 8df3bdd..fe28b1a 100755 --- a/tests/script_tests.py +++ b/tests/script_tests.py @@ -183,7 +183,7 @@ import_module(prefix + script_name) -class TestScriptMeta(MetaTestCaseClass): +class ScriptTestMeta(MetaTestCaseClass): """Test meta class.""" @@ -327,7 +327,7 @@ return super().__new__(cls, name, bases, dct) -class TestScriptHelp(PwbTestCase, metaclass=TestScriptMeta): +class TestScriptHelp(PwbTestCase, metaclass=ScriptTestMeta): """Test cases for running scripts with -help. @@ -348,7 +348,7 @@ class TestScriptSimulate(DefaultSiteTestCase, PwbTestCase, - metaclass=TestScriptMeta): + metaclass=ScriptTestMeta): """Test cases for running scripts with -siumlate. @@ -388,7 +388,7 @@ class TestScriptGenerator(DefaultSiteTestCase, PwbTestCase, - metaclass=TestScriptMeta): + metaclass=ScriptTestMeta): """Test cases for running scripts with a generator.""" diff --git a/tests/ui_tests.py b/tests/ui_tests.py index ff9130b..8b759e2 100755 --- a/tests/ui_tests.py +++ b/tests/ui_tests.py @@ -84,7 +84,7 @@ return self.strin.readline().strip() -class TestExceptionError(Exception): +class ExceptionTestError(Exception): """Test exception.""" @@ -154,8 +154,8 @@ def test_exception(self): try: - raise TestExceptionError('Testing Exception') - except TestExceptionError: + raise ExceptionTestError('Testing Exception') + except ExceptionTestError: pywikibot.error('exception', exc_info=False) self.assertEqual(self.strout.getvalue(), '') self.assertEqual(self.strerr.getvalue(), @@ -163,17 +163,17 @@ def test_exception_empty(self): try: - raise TestExceptionError('Testing Exception') - except TestExceptionError: + raise ExceptionTestError('Testing Exception') + except ExceptionTestError: pywikibot.exception(exc_info=False) self.assertEqual(self.strout.getvalue(), '') self.assertEqual(self.strerr.getvalue(), - 'ERROR: Testing Exception (TestExceptionError)\n') + 'ERROR: Testing Exception (ExceptionTestError)\n') def test_exception_tb(self): try: - raise TestExceptionError('Testing Exception') - except TestExceptionError: + raise ExceptionTestError('Testing Exception') + except ExceptionTestError: pywikibot.exception() self.assertEqual(self.strout.getvalue(), '') stderrlines = self.strerr.getvalue().split('\n') @@ -181,7 +181,7 @@ 'ERROR: Testing Exception') self.assertEqual(stderrlines[1], 'Traceback (most recent call last):') self.assertEqual(stderrlines[3], - " raise TestExceptionError('Testing Exception')") + " raise ExceptionTestError('Testing Exception')") end_str = ': Testing Exception' self.assertTrue(stderrlines[-1].endswith(end_str), -- To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/859450 To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Change-Id: I8db1166e6fbc24479ed4eece414f013f30d125c4 Gerrit-Change-Number: 859450 Gerrit-PatchSet: 2 Gerrit-Owner: Xqt <i...@gno.de> Gerrit-Reviewer: Xqt <i...@gno.de> Gerrit-Reviewer: jenkins-bot Gerrit-MessageType: merged
_______________________________________________ Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org