mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-26 07:30:08 -05:00
Move simulator instantiation to factory functions that automatically disable async ECL output. This prevents future contributors from forgetting the --enable-async-ecl-output=false flag. - Add create_black_oil_simulator/create_gas_water_simulator to pytest_common - Define ENABLE_ASYNC_ECL_OUTPUT_FLAG constant - Update all tests to use factory functions - No functional changes, pure refactoring
20 lines
653 B
Python
20 lines
653 B
Python
import os
|
|
import unittest
|
|
from pathlib import Path
|
|
from .pytest_common import pushd, create_black_oil_simulator
|
|
|
|
class TestBasic(unittest.TestCase):
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
test_dir = Path(os.path.dirname(__file__))
|
|
cls.data_dir = test_dir.parent.joinpath("test_data/SPE1CASE1a")
|
|
|
|
def test_all(self):
|
|
with pushd(self.data_dir):
|
|
sim = create_black_oil_simulator(filename="SPE1CASE1.DATA")
|
|
# NOTE: The following call should throw an exception since the simulation
|
|
# has not been initialized
|
|
with self.assertRaises(RuntimeError):
|
|
sim.get_dt()
|
|
|