From 53b69f507eac5415d1891612ecbe2aec623a5192 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 3 Apr 2017 19:19:37 +0200 Subject: [PATCH] allow index.TestCase to work when run using any path --- tests/index.TestCase | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/index.TestCase b/tests/index.TestCase index bbfac7bf..780da775 100755 --- a/tests/index.TestCase +++ b/tests/index.TestCase @@ -1,9 +1,18 @@ #!/usr/bin/env python3 + +import inspect import optparse import os +import sys import unittest import zipfile +localmodule = os.path.realpath( + os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..')) +print('localmodule: ' + localmodule) +if localmodule not in sys.path: + sys.path.insert(0, localmodule) + import fdroidserver.common import fdroidserver.index import fdroidserver.signindex -- 2.30.2