#7208 closed defect (fixed)
EnvironmentStub missing config data for sqlite::memory:
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.1 |
Component: | database backend | Version: | |
Severity: | minor | Keywords: | testing |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
While testing using the EnvironmentStub, if one want to make use of the ConnectionManager and a Connector to use for example the to_sql()
method, an exception is rosen because the default string for sqlite connection point to sqlite:db/trac.db
which doesn't match with the in memory DB. I fixed the problem adding the following line in the trac.test.py
file @178:
if not os.path.isabs(self.path): self.path = os.path.join(os.getcwd(), self.path) self.config = Configuration(None) # Set the connection type in the config as sqlite in memory self.config.set('trac', 'database', 'sqlite::memory:') # We have to have a ticket-workflow config for ''lots'' of things to # work. So insert the basic-workflow config here. There may be a # better solution than this. load_workflow_config_snippet(self.config, 'basic-workflow.ini')
Attachments (2)
Change History (8)
by , 17 years ago
Attachment: | test.py.diff added |
---|
follow-up: 2 comment:1 by , 17 years ago
Keywords: | testing added |
---|---|
Milestone: | → 0.12 |
Severity: | normal → minor |
Could you also upload a small test program reproducing the problem?
by , 17 years ago
Attachment: | breaking_env.py added |
---|
Script to break the sqlite_backend.py via EnvironmentStub
comment:2 by , 17 years ago
Replying to cboos:
Could you also upload a small test program reproducing the problem?
Sure, here you go… with the patch it works, without it breaks :-)
Of course we could debate on the fact that the DatabaseManager._get_connector()
is private… but still… ;-)
comment:3 by , 14 years ago
Is this still needed, now that we can run the tests against all database backends?
follow-up: 6 comment:4 by , 14 years ago
Component: | general → database backend |
---|---|
Milestone: | next-major-0.1X → 0.12.1 |
Owner: | changed from | to
I think this is actually what makes the tests fail in #9470.
comment:5 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Slightly modified patch applied in r10067.
comment:6 by , 14 years ago
this is actually what makes the tests fail in #9470
Actually no, it's a bit more involved than that.
Diff file for test.py