]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git/blobdiff - tests/helper.py
Move acceptance tests to common directory
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git] / tests / helper.py
index 4548b169f430ed0abbd6e78ddc1963171fc5e1c9..b85bf3ac58d8967edf0c7d691e3de2870b3f1374 100644 (file)
@@ -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