Browse Source

Added a flag to skip very slow tests (e.g., pn_simulate_larger)

Yentl Van Tendeloo 7 years ago
parent
commit
42ea08d75a
3 changed files with 11 additions and 1 deletions
  1. 3 0
      integration/conftest.py
  2. 2 1
      integration/test_mvc.py
  3. 6 0
      integration/utils.py

+ 3 - 0
integration/conftest.py

@@ -0,0 +1,3 @@
+import pytest
+def pytest_addoption(parser):
+    parser.addoption("--runslow", action="store_true", help="run slow tests")

+ 2 - 1
integration/test_mvc.py

@@ -1,6 +1,6 @@
 import unittest
 
-from utils import run_file, get_constructor, get_model_constructor
+from utils import *
 
 all_files = [   "core/mini_modify.alc",
                 "core/core_formalism.mvc",
@@ -852,6 +852,7 @@ class TestModelverseCore(unittest.TestCase):
             ],
             mode))
 
+    @slow
     def test_po_transform_add_MT_pn_simulate_larger(self):
         self.transform_add_MT_pn_simulate_larger("PO")
 

+ 6 - 0
integration/utils.py

@@ -10,6 +10,7 @@ import urllib2
 import subprocess
 import signal
 import random
+import pytest
 
 sys.path.append("interface/HUTN")
 sys.path.append("scripts")
@@ -19,6 +20,11 @@ from check_objects import to_recompile
 taskname = "test_task"
 parallel_push = True
 
+slow = pytest.mark.skipif(
+    not pytest.config.getoption("--runslow"),
+        reason="need --runslow option to run"
+)
+
 ports = set()
 
 def getFreePort():