2017-03-14 1 views

Antwort

0

Anscheinend tun Sie es wie so

Schritt eins, erstellen Sie einen Dekorateur

def skip_if(condition): 
    """Conditionally skips a test""" 
    def wrapper(f): 
     f.__test__ = not condition 
     return f 

    return wrapper 

Schritt zwei, verwenden sys.platform in Ihrem Zustand

import sys 
@skip_if(sys.platform != "linux") 
def test_linux_only() 
    linus_torvalds() 
Verwandte Themen