Merge lp:~jbaker/storm/nose_plugin into lp:storm

Proposed by Jason Baker
Status: Rejected
Rejected by: Jürgen Gmach
Proposed branch: lp:~jbaker/storm/nose_plugin
Merge into: lp:storm
Diff against target: 80 lines (+50/-1)
2 files modified
setup.py (+13/-1)
storm/nose_plugin.py (+37/-0)
To merge this branch: bzr merge lp:~jbaker/storm/nose_plugin
Reviewer Review Type Date Requested Status
Jürgen Gmach Disapprove
Storm Developers Pending
Review via email: mp+15506@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jason Baker (jbaker) wrote :

This branch adds a nose plugin to aid writing tests using storm. It allows users to turn the debug setting on by a command-line switch.

Revision history for this message
Jürgen Gmach (jugmac00) wrote :

Meanwhile Nose is unmaintained and obsolete as a Python test runner.

review: Disapprove

Unmerged revisions

353. By Jason Baker <jason@ubuntu>

Adding nose plugin.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'setup.py'
--- setup.py 2008-06-16 11:21:02 +0000
+++ setup.py 2009-12-01 19:05:23 +0000
@@ -4,8 +4,10 @@
44
5try:5try:
6 from setuptools import setup, Extension6 from setuptools import setup, Extension
7 use_setuptools = True
7except ImportError:8except ImportError:
8 from distutils.core import setup, Extension9 from distutils.core import setup, Extension
10 use_setuptools = False
911
1012
11if os.path.isfile("MANIFEST"):13if os.path.isfile("MANIFEST"):
@@ -28,6 +30,15 @@
28 packages.append(directory.replace(os.sep, '.'))30 packages.append(directory.replace(os.sep, '.'))
29 return packages31 return packages
3032
33if use_setuptools:
34 setuptools_kwargs = {
35 'entry_points' : {
36 'nose.plugins.0.10' : [
37 'storm_debug = storm.nose_plugin:StormDebug'],
38 }
39 }
40else:
41 setuptools_kwargs = {}
3142
32setup(43setup(
33 name="storm",44 name="storm",
@@ -54,5 +65,6 @@
54 "Topic :: Software Development :: Libraries :: Python Modules",65 "Topic :: Software Development :: Libraries :: Python Modules",
55 ],66 ],
56 ext_modules=(BUILD_CEXTENSIONS and67 ext_modules=(BUILD_CEXTENSIONS and
57 [Extension("storm.cextensions", ["storm/cextensions.c"])])68 [Extension("storm.cextensions", ["storm/cextensions.c"])]),
69 **setuptools_kwargs
58)70)
5971
=== added file 'storm/nose_plugin.py'
--- storm/nose_plugin.py 1970-01-01 00:00:00 +0000
+++ storm/nose_plugin.py 2009-12-01 19:05:23 +0000
@@ -0,0 +1,37 @@
1#
2# Copyright (c) 2006, 2007 Canonical
3#
4# Written by Gustavo Niemeyer <gustavo@niemeyer.net>
5#
6# This file is part of Storm Object Relational Mapper.
7#
8# Storm is free software; you can redistribute it and/or modify
9# it under the terms of the GNU Lesser General Public License as
10# published by the Free Software Foundation; either version 2.1 of
11# the License, or (at your option) any later version.
12#
13# Storm is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Lesser General Public License for more details.
17#
18# You should have received a copy of the GNU Lesser General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21"""
22This module contains a plugin to support enabling sql debugging.
23"""
24
25import sys
26from nose.plugins.base import Plugin
27from storm.tracer import debug
28
29class StormDebug(Plugin):
30 """
31 Enable outputting storm debug info.
32 """
33 def begin(self):
34 if self.enabled:
35 debug(True, sys.stdout)
36 else:
37 debug(False, sys.stdout)

Subscribers

People subscribed via source and target branches

to status/vote changes: