jenkins-bot has submitted this change and it was merged. Change subject: Fix running tests on Python 3 ......................................................................
Fix running tests on Python 3 The metaclass syntax changed in Python 3, so use the six module to provide a way of supporting both Python 2 and 3. Also enable py3 environments in tox. Bug: T142455 Change-Id: Ied334dfb7a392220edff1eed076e42b580582103 --- M commit_message_validator/tests/test_commit-message-validator.py M tox.ini 2 files changed, 6 insertions(+), 3 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/commit_message_validator/tests/test_commit-message-validator.py b/commit_message_validator/tests/test_commit-message-validator.py index 079f194..ae8101d 100644 --- a/commit_message_validator/tests/test_commit-message-validator.py +++ b/commit_message_validator/tests/test_commit-message-validator.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os +from six import with_metaclass import sys import unittest @@ -52,11 +53,11 @@ return super(MetaValidator, cls).__new__(cls, name, bases, dct) -class TestCommitMessageValidator(unittest.TestCase): +class TestCommitMessageValidator(with_metaclass(MetaValidator, unittest.TestCase)): """Validate the commit messages using test files.""" - __metaclass__ = MetaValidator + pass if __name__ == '__main__': diff --git a/tox.ini b/tox.ini index c7ad3a9..1fa0f8f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] # Environements to execute when invoking 'tox' -envlist = flake8,flake8-py3,py27 +envlist = flake8,flake8-py3,py27,py33,py34,py35 +skip_missing_interpreters = True [testenv:flake8] commands = flake8 @@ -16,6 +17,7 @@ [testenv] commands = python setup.py test deps = nose + six [flake8] exclude = .tox -- To view, visit https://gerrit.wikimedia.org/r/303970 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied334dfb7a392220edff1eed076e42b580582103 Gerrit-PatchSet: 1 Gerrit-Project: integration/commit-message-validator Gerrit-Branch: master Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: BryanDavis <bda...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits