X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fhelper.py;h=b85bf3ac58d8967edf0c7d691e3de2870b3f1374;hb=e8b0c21d62d72d955c21cb3047951433b1655745;hp=fcb0e9dc3575d9c1426d016214fcc5183bde1e83;hpb=c8df27385e02b22d36b240fe29532e97dbba1f43;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git diff --git a/tests/helper.py b/tests/helper.py index fcb0e9d..b85bf3a 100644 --- a/tests/helper.py +++ b/tests/helper.py @@ -6,9 +6,19 @@ import requests_mock from io import StringIO import portfolio, market, main, store -__all__ = ["unittest", "WebMockTestCase", "mock", "D", +__all__ = ["limits", "unittest", "WebMockTestCase", "mock", "D", "StringIO"] +limits = ["acceptance", "unit"] +for test_type in limits: + if "--no{}".format(test_type) in sys.argv: + sys.argv.remove("--no{}".format(test_type)) + limits.remove(test_type) + if "--only{}".format(test_type) in sys.argv: + sys.argv.remove("--only{}".format(test_type)) + limits = [test_type] + break + class WebMockTestCase(unittest.TestCase): import time @@ -32,6 +42,7 @@ class WebMockTestCase(unittest.TestCase): last_date=store.LockedVar(None), report=mock.Mock(), worker=None, + worker_tag="", worker_notify=None, worker_started=False, callback=None),