From b4675031ed9b2313e9df5cd73dc2575bec67192b Mon Sep 17 00:00:00 2001 From: Joachim Krebs Date: Thu, 16 Dec 2010 01:27:25 +0000 Subject: Fixed relative path test for Mako templates, enabling non-setup.py test runners. --- pyramid/tests/test_mako_templating.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyramid/tests/test_mako_templating.py b/pyramid/tests/test_mako_templating.py index 4d1c49863..85423b588 100644 --- a/pyramid/tests/test_mako_templating.py +++ b/pyramid/tests/test_mako_templating.py @@ -3,6 +3,9 @@ import unittest from pyramid import testing +import sys +import os.path + class Base(object): def setUp(self): self.config = testing.setUp() @@ -70,7 +73,10 @@ class Test_renderer_factory(Base, unittest.TestCase): }) self._callFUT(info) lookup = self.config.registry.getUtility(IMakoLookup) - self.assertEqual(lookup.directories, ['a', 'b']) + module_path = os.path.dirname(sys.modules['__main__'].__file__) + self.assertEqual(lookup.directories, [ + os.path.join(module_path, 'a'), + os.path.join(module_path, 'b')]) def test_with_module_directory_resource_spec(self): import os -- cgit v1.2.3