On Tue, Jun 9, 2015 at 12:07 PM, Jun Omae <[email protected]> wrote:
> Reproduced on CentOS 6 and 7. I just confirmed that all tests pass on
> Ubuntu 12.04.
> I'll investigate it.
Reproduced on Ubuntu 12.04. The test failing when it run by root user
(or using fakeroot utility).
$ fakeroot /tmp/tracvenv/bin/python setup.py test -s
trac.db.tests.sqlite_test.suite
...
Ran 3 tests in 0.223s
FAILED (failures=2)
The following patch would fix the issue. I'll apply this to 1.0-stable later.
diff --git a/trac/db/tests/sqlite_test.py b/trac/db/tests/sqlite_test.py
index c1ccefd..d1fb3ea 100644
--- a/trac/db/tests/sqlite_test.py
+++ b/trac/db/tests/sqlite_test.py
@@ -78,9 +78,12 @@ class DatabaseFileTestCase(unittest.TestCase):
except ConfigurationError, e:
self.assertIn('requires read _and_ write permissions', unicode(e))
+ if os.name == 'posix' and os.getuid() == 0:
+ del test_no_permissions # For root, os.access() always returns True
+
def test_error_with_lazy_translation(self):
self._create_env()
- os.chmod(self.db_path, 0444)
+ os.remove(self.db_path)
env = Environment(self.env_path)
chrome = Chrome(env)
dispatcher = RequestDispatcher(env)
@@ -94,7 +97,9 @@ class DatabaseFileTestCase(unittest.TestCase):
self._db_query(env)
self.fail('ConfigurationError not raised')
except ConfigurationError, e:
- self.assertIn('requires read _and_ write permissions', unicode(e))
+ message = unicode(e)
+ self.assertIn('Database "', message)
+ self.assertIn('" not found.', message)
finally:
translation.deactivate()
--
Jun Omae <[email protected]> (大前 潤)
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.