From 12e2827286f4ea5cd56ddc9775090f1a7293a7f5 Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Tue, 27 Sep 2016 16:01:47 -0700 Subject: [PATCH] tests requiring epoll should only run on linux --- tests/functional/test_misc.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/functional/test_misc.py b/tests/functional/test_misc.py index 8e116a7ac..c478c165a 100644 --- a/tests/functional/test_misc.py +++ b/tests/functional/test_misc.py @@ -1,6 +1,7 @@ import shutil from multiprocessing import Process, Event, Queue import logging +import platform import sys import random import io @@ -50,6 +51,15 @@ log_format = "%(funcName)s(): %(message)s" logging.basicConfig(level=logging.WARNING, format=log_format) +def require_system(system): + def wrapper(fn): + return fn + if platform.system() == system: + return wrapper + else: + return unittest.skip("Skipping. Test can only be run on " + system) + + class FakeNode(object): def __init__(self, *args, **kwargs): pass @@ -845,6 +855,7 @@ class TestTransfer(TestCase): return d + @require_system('Linux') def test_live_transfer(self): sd_hash_queue = Queue() @@ -940,6 +951,7 @@ class TestTransfer(TestCase): d.addBoth(stop) return d + @require_system('Linux') def test_last_blob_retrieval(self): kill_event = Event()