mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
mark test tutorials as slow test
This commit is contained in:
parent
331c0b9486
commit
7afbe4d7d1
20
tests/pytest/conftest.py
Normal file
20
tests/pytest/conftest.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
"""
|
||||||
|
Pytest configuration file to run slow test only if pytest is started with option --runslow or if
|
||||||
|
environment variable RUN_SLOW_TESTS is set.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import pytest, os
|
||||||
|
|
||||||
|
def pytest_addoption(parser):
|
||||||
|
parser.addoption("--runslow", action="store_true", default=False, help="run slow tests")
|
||||||
|
|
||||||
|
def pytest_configure(config):
|
||||||
|
config.addinivalue_line("markers", "slow: mark test as slow to run")
|
||||||
|
|
||||||
|
|
||||||
|
def pytest_collection_modifyitems(config, items):
|
||||||
|
if not (('RUN_SLOW_TESTS' in os.environ and os.environ['RUN_SLOW_TESTS']) or config.getoption("--runslow")):
|
||||||
|
skip_slow = pytest.mark.skip(reason="need --runslow option to run")
|
||||||
|
for item in items:
|
||||||
|
if "slow" in item.keywords:
|
||||||
|
item.add_marker(skip_slow)
|
@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
import os, pytest
|
import os, pytest
|
||||||
from netgen.meshing import meshsize, MeshingParameters, SetMessageImportance
|
from netgen.meshing import meshsize, MeshingParameters, SetMessageImportance
|
||||||
import netgen.gui
|
|
||||||
import netgen.csg as csg
|
import netgen.csg as csg
|
||||||
import netgen.stl as stl
|
import netgen.stl as stl
|
||||||
try:
|
try:
|
||||||
@ -61,6 +60,7 @@ def generateMesh(filename, mp):
|
|||||||
geo = occ.OCCGeometry(os.path.join("..","..","tutorials", filename))
|
geo = occ.OCCGeometry(os.path.join("..","..","tutorials", filename))
|
||||||
return geo.GenerateMesh(**mp)
|
return geo.GenerateMesh(**mp)
|
||||||
|
|
||||||
|
@pytest.mark.slow
|
||||||
@pytest.mark.parametrize("filename, checkFunc", [(f, getCheckFunc(f)) for f in _geofiles])
|
@pytest.mark.parametrize("filename, checkFunc", [(f, getCheckFunc(f)) for f in _geofiles])
|
||||||
def test_geoFiles(filename, checkFunc):
|
def test_geoFiles(filename, checkFunc):
|
||||||
for i, mp in enumerate(getMeshingparameters(filename)):
|
for i, mp in enumerate(getMeshingparameters(filename)):
|
||||||
|
Loading…
Reference in New Issue
Block a user