I've just pushed 1.0 -- the *I Heart Data* release -- of fixture, a
Python module for loading and referencing test data. It is used
heavily at my work in two test suites: one for the functional tests of
an ETL framework and another for a Pylons + Elixir (SQLAlchemy) + Ext
JS web application.
On Jan 25, 2008 11:58 AM, Michael Bayer [EMAIL PROTECTED] wrote:
...so this
test will pass if you change setUp to read:
Session.mapper(SomeObject, table, properties={
'options':relation(SomeOtherObject)
}, save_on_init=False)
On Jan 24, 2008 2:46 PM, Kumar McMillan [EMAIL PROTECTED] wrote:
but, since I am explicitly saving it to a new session and the session
has a different scope, shouldn't this be possible? Maybe I'm not
fully understanding scoped sessions.
I am hesitant to file this as a bug because I'm not sure
This is a spin-off from the thread on how to do setup/test-app/teardown:
http://groups.google.com/group/sqlalchemy/browse_thread/thread/4fd6344bf8b9c033
(thanks for everyone's help on that)
I had posted test code that illustrates it's possible to save/delete a
mapped object using two different
Hello, I have not been able to figure this out from the docs.
I would like to setup and teardown test data using mapped classes.
The problem is that those same mapped classes need to be used by the
application under test and in case there is an error, the teardown
still needs to run so that
Hi
On Jan 23, 2008 4:07 PM, Michael Bayer [EMAIL PROTECTED] wrote:
your teardown code can't have any dependencies on the test code
itself. So at the very least start the teardown phase with
PrivateSession.close() so that you start fresh.
I tried adding that to the teardown code but then
On Jan 23, 2008 4:36 PM, Kumar McMillan [EMAIL PROTECTED] wrote:
...but it still fails with the same error, Deleted rowcount 0 does not
match number of objects deleted 1. What am I missing? I don't
understand how the teardown code is dependent on the app code if it is
using a different
Thanks for the quick response.
On 9/24/07, Michael Bayer [EMAIL PROTECTED] wrote:
but also i dont understand the problem you're having. the
ConcurrentModificationError should only happen if you are issuing a
literal DELETE statement to the database which conflicts with the
session trying to
Hello.
I have a naive system that links dict-like objects to mapped classes
so that rows can be saved to the db. It doesn't know anything about
mapped class instances, so many-to-many relationships are [currently]
saved by a class mapped to the swing table itself; for example, it's
the
,
or hack your python like i did).
Kumar McMillan wrote:
put a file -pythonpath.pth into your site_packages folder:
import os, sys; sys.__egginsert=len(os.environ.get('PYTHONPATH',
'').split(os.pathsep));
duly noted for future usage _when_ i meet an egg.
workingenv, as Simon
put a file -pythonpath.pth into your site_packages folder:
import os, sys; sys.__egginsert=len(os.environ.get('PYTHONPATH',
'').split(os.pathsep));
duly noted for future usage _when_ i meet an egg.
workingenv, as Simon King mentioned, is the way to go. At my company
we share a dev
db = SQLAlchemyFixture()
# anytime before db.data().setup() ...
db.session = my_session
In my current system I have a single global session that is used for
everything. Is there any reason you can see that I could not just
reuse this session in all the test cases or should I be
I have a program that is entering a deadlock (pyscopg) after an
exception since the test suite tries to delete stuff as part of
cleanup. I tried wrapping everything in a transaction to be sure a
rollback is called but it *appears* that when I start using
transaction.session.bind_to.execute(stmt)
...but it *appears* that when I start using
transaction.session.bind_to.execute(stmt) directly, it is not part of
the transaction.
uh yeah...why would it be ? youre essentially pulling out the
original bind_to engine which has no idea about what particular
connection/transaction is
/07, Kumar McMillan [EMAIL PROTECTED] wrote:
the fact that the deadlock was solved when I added the connection to
the transaction tells me that psycopg runs in commit mode
automatically (even though dbapi 2 says it should not). The psycopg
docs reinforce this too :
http://www.initd.org
I'm trying to work on something where it's necessary to discover table
objects and then perform inserts and deletes in a transaction. It's
proving very cumbersome to try and locate the existing mappers for
these tables or create them automatically so I'm now trying to work
directly with
, not sure.
also the sql echo shows that something is weird...its inserting a
row, then deleting it, using id 1, which is what the id should be.
the rowcount should definitely be 1 and not 0.
On Jan 11, 2007, at 8:30 PM, Kumar McMillan wrote:
hi. the reason for the flush strangeness is I
oh, nice. upgrading sqlite to 3.3.7 and rebuilding pysqlite2 fixed it
-- sorry for the noise.
On 1/12/07, Kumar McMillan [EMAIL PROTECTED] wrote:
uggh, pysqlite 2.1 fixed some other problems I was having in
transactions iirc. I'm scared to upgrade/downgrade :(
On 1/11/07, Michael Bayer
hello.
I'm trying to use DynamicMetaData so that two separate tests can each
connect to a unique db, create some tables, insert some data, delete
that data, then drop the tables.
This seems to yield ...
sqlalchemy.exceptions.ConcurrentModificationError: Updated rowcount 0
does not match number
19 matches
Mail list logo