From: Eric Leblond Date: Thu, 21 Jun 2018 14:47:47 +0000 (+0200) Subject: tests/py: fix import when run from other directory X-Git-Tag: v0.9.1~371 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b94e51f2d61657e1165ee64eccb3b237e624985d;p=thirdparty%2Fnftables.git tests/py: fix import when run from other directory Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index 1c736be4..e4367adc 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -19,11 +19,11 @@ import argparse import signal import json -sys.path.insert(0,'../../py/') +TESTS_PATH = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.join(TESTS_PATH, '../../py/')) from nftables import Nftables -TESTS_PATH = os.path.dirname(os.path.abspath(__file__)) TESTS_DIRECTORY = ["any", "arp", "bridge", "inet", "ip", "ip6"] LOGFILE = "/tmp/nftables-test.log" log_file = None