[PATCH] tests: Find test data relative to file location

Dirk Wallenstein halsmit at t-online.de
Thu May 3 22:45:39 EST 2012


Make test execution independent of the current directory.

Signed-off-by: Dirk Wallenstein <halsmit at t-online.de>
---
 apps/patchwork/tests/utils.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/patchwork/tests/utils.py b/apps/patchwork/tests/utils.py
index 1cb5dfb..f340f09 100644
--- a/apps/patchwork/tests/utils.py
+++ b/apps/patchwork/tests/utils.py
@@ -32,8 +32,8 @@ except ImportError:
     from email.MIMEMultipart import MIMEMultipart
 
 # helper functions for tests
-_test_mail_dir  = 'patchwork/tests/mail'
-_test_patch_dir = 'patchwork/tests/patches'
+_test_mail_dir  = os.path.join(os.path.dirname(__file__), 'mail')
+_test_patch_dir = os.path.join(os.path.dirname(__file__), 'patches')
 
 class defaults(object):
     project = Project(linkname = 'test-project', name = 'Test Project')
-- 
1.7.9.5



More information about the Patchwork mailing list