From 5d211b0c84026d1e0b23247026a40ca534b867a8 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sat, 9 Jun 2018 17:35:09 -0700 Subject: [PATCH] monkeytestit tests: Use unittest.skipIf to disable tests on python < 3.5. --- .../zulip_bots/bots/monkeytestit/test_monkeytestit.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/zulip_bots/zulip_bots/bots/monkeytestit/test_monkeytestit.py b/zulip_bots/zulip_bots/bots/monkeytestit/test_monkeytestit.py index fd06172..f29e4db 100644 --- a/zulip_bots/zulip_bots/bots/monkeytestit/test_monkeytestit.py +++ b/zulip_bots/zulip_bots/bots/monkeytestit/test_monkeytestit.py @@ -1,13 +1,11 @@ -import unittest -from unittest import mock +from unittest import mock, skipIf + +from sys import version_info from importlib import import_module from zulip_bots.test_lib import BotTestCase, DefaultTests - -# TODO: Figure out a way to test bots that depends -# on the Python version of the environment. -@unittest.skip("Fails on Python3.4.") +@skipIf(version_info[:2] < (3, 5), "monkeytestit requires python3.5+") class TestMonkeyTestitBot(BotTestCase, DefaultTests): bot_name = "monkeytestit"