--- a/tests/test_saveload.py 2018-02-11 15:08:45.000000000 +0100 +++ b/tests/test_saveload.py 2018-02-23 09:41:17.335712453 +0100 @@ -14,7 +14,7 @@ except ImportError: DILL_AVAILABLE = False -dat = np.loadtxt(os.path.join('..', 'examples', 'NIST_Gauss2.dat')) +dat = np.loadtxt(os.path.join(os.path.dirname(__file__), '..', 'examples', 'NIST_Gauss2.dat')) XDAT = dat[:, 1] YDAT = dat[:, 0] --- a/tests/test_height_fwhm.py 2018-02-11 15:08:45.000000000 +0100 +++ b/tests/test_height_fwhm.py 2018-02-23 09:41:41.030806931 +0100 @@ -8,6 +8,7 @@ from scipy.optimize import fsolve import sys +import os # Turn off plotting if run by nosetests. WITHPLOT = True @@ -76,7 +76,7 @@ # sigma = np.sqrt(variance) # x = np.linspace(mu - 20*sigma, mu + 20*sigma, 100.0) # y = norm.pdf(x, mu, 1) - data = np.loadtxt('../examples/test_peak.dat') + data = np.loadtxt(os.path.join(os.path.dirname(__file__), '..', 'examples', 'test_peak.dat')) x = data[:, 0] y = data[:, 1] check_height_fwhm(x, y, lineshapes.voigt, models.VoigtModel())