Skip to content

Commit

Permalink
[Mod] skip tests if extensions not built.
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoric committed Jul 5, 2019
1 parent 574853d commit 099b529
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_import_all.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# flake8: noqa
import platform
import unittest
from os import environ


def check_env(key: str, default=None):
return environ.get(key, default)


# noinspection PyUnresolvedReferences,PyMethodMayBeStatic
Expand Down Expand Up @@ -33,6 +38,7 @@ def test_import_ctp(self):
from vnpy.gateway.ctp import CtpGateway

@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
@unittest.skipIf(platform.system() == "Linux", "Not supported yet under Linux")
def test_import_ctptest(self):
from vnpy.gateway.ctptest import CtptestGateway

Expand All @@ -54,6 +60,7 @@ def test_import_ib(self):
from vnpy.gateway.ib import IbGateway

@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
@unittest.skipIf(check_env('VNPY_BUILD_OES') == '0', "Skip because of VNPY_BUILD_OES==0")
def test_import_oes(self):
from vnpy.gateway.oes import OesGateway

Expand All @@ -75,6 +82,7 @@ def test_import_tiger(self):
from vnpy.gateway.tiger import TigerGateway

@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
@unittest.skipIf(platform.system() == "Linux", "Not supported yet under Linux")
def test_import_tora(self):
from vnpy.gateway.tora import ToraGateway

Expand Down

0 comments on commit 099b529

Please sign in to comment.