From 6cdbcc8edeabfb8c32da6da04314713957e2ee11 Mon Sep 17 00:00:00 2001 From: enkore Date: Fri, 17 Oct 2014 16:25:04 +0200 Subject: [PATCH] This seems to be different behaviour between py.test and nose nosetests problably switched to the current tests directory before executing them. --- tests/test_battery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_battery.py b/tests/test_battery.py index 72a41ff..d50aa2f 100644 --- a/tests/test_battery.py +++ b/tests/test_battery.py @@ -1,12 +1,12 @@ #!/usr/bin/env python -import unittest +import os.path from i3pystatus import battery def battery_test(path, format, expected): - bc = battery.BatteryChecker(path=path, format=format) + bc = battery.BatteryChecker(path=os.path.dirname(__file__) + "/" + path, format=format) bc.run() assert bc.output["full_text"] == expected