Re: [SQLObject] Python 2.7.12 + tox + PostgreSQL
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2016-08-26 15:49:09
|
Hi! On Fri, Aug 26, 2016 at 10:42:04AM -0500, Ian Cordasco <gra...@gm...> wrote: > On Aug 25, 2016 4:19 PM, "Oleg Broytman" <ph...@ph...> wrote: > > > Hi, All! > > > > Recently tests started to fail both at Travis and Circle, but only > > with Postgres. Initially I couldn't reproduce the problem locally but > > after a dozen of experiments I got it: the problem manifests itself > > only with Python 2.7.12 + tox + PostgreSQL. I have to install Python > > 2.7.12 and tox to reproduce it locally (I have Debian with Python 2.7.9 > > and I usually don't use tox - I run py.test directly). > > > > Somehow I managed to fix tests by changing test order - I explicitly > > listed tests directories with 'tests' at the top of the other dirs. Now > > tests passed locally and at both CIs. > > > > I understand neither the problem nor the solution. :-( Any idea? > > Can you share a link to the reordering that fixed this? I won't pretend to > understand it either, but there is typically a difference between how tox > runs tests and how you might be running them. https://github.com/sqlobject/sqlobject/commit/c0737d14122550cfe965d193d899c8ab0801999d Usually py.test lists tests directories in alphabetical order: "include/tests inheritance/tests tests versioning/test". I put "tests" at the front: "tests include/tests inheritance/tests versioning/test" and that fixes the problem both locally and at CIs. > tox will install sqlobject first and then run the tests against that > installed version (ideally). If you just run py.test directly, it might not > be installed and will be running against the local copy in git. Something > could be wrong about how sqlobject is being packaged. Could be, but why only with Postgres then? Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |