From 21f1fa9581a8a6ce167a3d50eeb4fdec10168a1a Mon Sep 17 00:00:00 2001 From: flothesof Date: Wed, 27 Nov 2019 16:38:46 +0100 Subject: [PATCH 1/2] fix failing unit test due to separator not working on Windows --- tofu/tests/tests09_tutorials/tests01_runall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/tests/tests09_tutorials/tests01_runall.py b/tofu/tests/tests09_tutorials/tests01_runall.py index e20341724..0009660b0 100644 --- a/tofu/tests/tests09_tutorials/tests01_runall.py +++ b/tofu/tests/tests09_tutorials/tests01_runall.py @@ -17,7 +17,7 @@ _HERE = os.path.abspath(os.path.dirname(__file__)) -_TFROOT = _HERE[:-_HERE[::-1].index('/tofu'[::-1])-len('/tofu')] +_TFROOT = os.path.abspath(os.path.join(os.path.dirname(_HERE), os.pardir)) # _TFROOT = tf.__path__[0][:-5] # _PATHTUTO = os.path.join(_TFROOT, 'examples', 'tutorials') keyVers = 'Vers' From a22d50aa49ed9b67ead7c01ff502129320e990d7 Mon Sep 17 00:00:00 2001 From: flothesof Date: Wed, 27 Nov 2019 17:46:12 +0100 Subject: [PATCH 2/2] cleaned up some imports and fixed _TFROOT --- tofu/tests/tests09_tutorials/tests01_runall.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/tofu/tests/tests09_tutorials/tests01_runall.py b/tofu/tests/tests09_tutorials/tests01_runall.py index 0009660b0..5fe4d66a5 100644 --- a/tofu/tests/tests09_tutorials/tests01_runall.py +++ b/tofu/tests/tests09_tutorials/tests01_runall.py @@ -1,25 +1,13 @@ - -# External modules import os import shutil -import types import subprocess -import numpy as np -import warnings as warn import matplotlib.pyplot as plt - -# Nose-specific -from nose import with_setup # optional - -# Importing package tofu.geom -import tofu as tf from tofu import __version__ - +from pathlib import Path _HERE = os.path.abspath(os.path.dirname(__file__)) -_TFROOT = os.path.abspath(os.path.join(os.path.dirname(_HERE), os.pardir)) -# _TFROOT = tf.__path__[0][:-5] -# _PATHTUTO = os.path.join(_TFROOT, 'examples', 'tutorials') +_TFROOT = Path(_HERE).parent.parent.parent + keyVers = 'Vers'