From b680d961989e0cf9c602feaafda551538b8be2e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Thu, 5 Nov 2020 09:48:39 +0100 Subject: [PATCH] The data directory is relative to the parent. The test data directory is relative to the parent directory, not the current directory. --- python/test/test_basic.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/test/test_basic.py b/python/test/test_basic.py index 1c431406e..933377b76 100755 --- a/python/test/test_basic.py +++ b/python/test/test_basic.py @@ -54,14 +54,15 @@ class TestBasic(unittest.TestCase): # in which each test_xxx() method is called by unittest is not defined). # However, as noted above this is not currently possible. # - cls.data_dir = os.path.join( os.path.dirname(__file__), "test_data/SPE1CASE1") + test_dir = Path(os.path.dirname(__file__)) + cls.data_dir = test_dir.parent.joinpath("test_data/SPE1CASE1") def test_all(self): - with self.pushd(cls.data_dir): + with pushd(self.data_dir): sim = BlackOilSimulator("SPE1CASE1.DATA") sim.step_init() - self.sim.step() + sim.step() poro = sim.get_porosity() self.assertEqual(len(poro), 300, 'length of porosity vector')