Ticket #1764 (closed enhancement: fixed)

Opened 1 year ago

Last modified 8 months ago

[PATCH] Add SQLAlchemy support to testutil.DBTest

Reported by: lmacken Assigned to: kskuhlman
Priority: low Milestone: 1.1b2
Component: TurboGears Version: 1.1 HEAD
Severity: minor Keywords: needs documentation
Cc: mramm

Description

The attached patch adds SQLAlchemy support to the testutil.DBTest class.

Attachments

TurboGears-1.0-DBTest-SQLAlchemy.patch (1.6 kB) - added by lmacken on 03/19/08 15:15:06.
TurboGears-1.1-DBTest-SQLAlchemy.patch (2.2 kB) - added by lmacken on 04/19/08 16:43:28.
An updated patch that doesn't wipe out our child classes setUp/tearDown methods in init
TurboGears-1.5-DBTest-SQLAlchemy.patch (2.2 kB) - added by kvdb on 08/16/08 10:09:10.
r1764.ken.patch (2.3 kB) - added by kskuhlman on 08/21/08 23:29:38.
Modified version to make classes discoverable by automated doc utils
dbwebtest.py (413 bytes) - added by kvdb on 08/22/08 04:36:57.
It's not a patch, just some code.

Change History

03/19/08 15:15:06 changed by lmacken

  • attachment TurboGears-1.0-DBTest-SQLAlchemy.patch added.

03/19/08 15:15:26 changed by lmacken

  • owner changed from mramm to lmacken.
  • status changed from new to assigned.
  • summary changed from Add SQLAlchemy support to testutil.DBTest to [PATCH] Add SQLAlchemy support to testutil.DBTest.

03/19/08 15:15:40 changed by lmacken

  • cc set to mramm.

03/19/08 16:32:05 changed by Chris Arndt

  • version changed from 0.5 to 1.0.4.4.

04/19/08 16:43:28 changed by lmacken

  • attachment TurboGears-1.1-DBTest-SQLAlchemy.patch added.

An updated patch that doesn't wipe out our child classes setUp/tearDown methods in init

08/16/08 10:08:58 changed by kvdb

This patch helped me quite a lot! Thanks!

Updated the patch for TG 1.5. [config.get -> turbogears.config.server.get]

Any reason the patch hasn't been applied in any branches yet? All 338 unittests run fine.

08/16/08 10:09:10 changed by kvdb

  • attachment TurboGears-1.5-DBTest-SQLAlchemy.patch added.

08/21/08 12:22:30 changed by kskuhlman

  • owner changed from lmacken to kskuhlman.
  • status changed from assigned to new.

08/21/08 13:21:58 changed by Chris Arndt

While we should definitely have better SA support in testutils, I don't like the idea of detecting the ORM to use in the setUp/tearDown methods via the dburi setting. Why not just provide a separate DBTest subclasses for each ORM, so that test authors can select what they need?

08/21/08 23:29:38 changed by kskuhlman

  • attachment r1764.ken.patch added.

Modified version to make classes discoverable by automated doc utils

08/21/08 23:32:15 changed by kskuhlman

  • status changed from new to assigned.

I've attached a patch that should meet the original objective as well as address Chris' concerns, as well as be discoverable to automated API documentation tools. I'd be interested in your feedback. Luke & kvdb, please confirm that it meets your needs & I'll commit it.

Please note that this change should not be considered API stable until it's been documented, unit tested (preferably in test_testutil), and confirmed to be forwards compatible with TG 2.0.

That said, it's a very, very useful idea, so thanks for the contribution!

08/22/08 04:35:53 changed by kvdb

A clean 1.5 branch checkout (r5198) with applied patch r1764.ken.patch needed 2 small modifications for me (config.get -> turbogears.config.server.get). I tested the SA bit, and it works.

So, please commit.

On a related note, you might also want to commit the attached dbwebtest patch. I found that code somewhere in trac (it's not mine), and use it quite a lot.

08/22/08 04:36:57 changed by kvdb

  • attachment dbwebtest.py added.

It's not a patch, just some code.

08/24/08 10:27:00 changed by faide

  • milestone changed from 1.5 to 1.1.

08/27/08 23:05:07 changed by kskuhlman

  • priority changed from normal to low.
  • version changed from 1.0.4.4 to 1.1 HEAD.
  • severity changed from normal to minor.

Committed that code in r5277. kvdb, I'm going to turn you down for now, since I'm not 100% sold on it's general utility. If you feel passionate about it, let's discuss on the mailing list.

Leaving ticket open so we don't forget the documentation issues I cited earlier.

08/28/08 05:57:16 changed by Chris Arndt

Please open a new ticket for the documentation issue and close this one, otherwise it gets really confusing to have lots of open tickets that are already implemented.

(Ideally you would provide the documentation together with the patch :) .)

09/10/08 16:53:03 changed by Chris Arndt

  • keywords set to needs documentation.
  • milestone changed from 1.1 to 1.1 beta 2.

11/12/08 16:15:51 changed by faide

  • status changed from assigned to closed.
  • resolution set to fixed.

Created a new ticket for the documentation task referencing this one. Closing.