This seems to be different behaviour between py.test and nose

nosetests problably switched to the current tests directory before executing them.
This commit is contained in:
enkore 2014-10-17 16:25:04 +02:00
parent 95718c27a8
commit 6cdbcc8ede

View File

@ -1,12 +1,12 @@
#!/usr/bin/env python #!/usr/bin/env python
import unittest import os.path
from i3pystatus import battery from i3pystatus import battery
def battery_test(path, format, expected): 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() bc.run()
assert bc.output["full_text"] == expected assert bc.output["full_text"] == expected