]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- the NoseSQLAlchemyPlugin has been moved to a
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 Oct 2010 19:23:14 +0000 (15:23 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 Oct 2010 19:23:14 +0000 (15:23 -0400)
new package "sqlalchemy_nose" which installs
along with "sqlalchemy".  This so that the "nosetests"
script works as always but also allows the
--with-coverage option to turn on coverage before
SQLAlchemy modules are imported, allowing coverage
to work correctly.
- added some new ignores

.hgignore
CHANGES
lib/sqlalchemy/test/__init__.py
lib/sqlalchemy/test/engines.py
lib/sqlalchemy/test/profiling.py
lib/sqlalchemy/test/testing.py
lib/sqlalchemy_nose/__init__.py [new file with mode: 0644]
lib/sqlalchemy_nose/config.py [moved from lib/sqlalchemy/test/config.py with 100% similarity]
lib/sqlalchemy_nose/noseplugin.py [moved from lib/sqlalchemy/test/noseplugin.py with 96% similarity]
setup.py
test/__init__.py

index ef7855faec89fc531b01159c085128e62aa4c695..a4a0ce2bc835b5375e731c76aeae77629e99be6c 100755 (executable)
--- a/.hgignore
+++ b/.hgignore
@@ -4,4 +4,7 @@ syntax:regexp
 .pyc$
 .orig$
 .egg-info
+.*,cover
+\.coverage
+\.DS_Store
 test.cfg
diff --git a/CHANGES b/CHANGES
index a2e864bdac18fe18f6cf54d1f11b007e71d001c4..7f055ea7afebd0d7b2734ead709d6eeb3c5fe847 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -202,7 +202,16 @@ CHANGES
    - *Major* cleanup / modernization of the Informix 
      dialect for 0.6, courtesy Florian Apolloner. 
      [ticket:1906]
-     
+
+- tests
+   - the NoseSQLAlchemyPlugin has been moved to a
+     new package "sqlalchemy_nose" which installs
+     along with "sqlalchemy".  This so that the "nosetests"
+     script works as always but also allows the 
+     --with-coverage option to turn on coverage before
+     SQLAlchemy modules are imported, allowing coverage
+     to work correctly.
+      
 - misc
    - CircularDependencyError now has .cycles and .edges
      members, which are the set of elements involved in
index d69cedefdda548d15eff75998cc79e46217458a8..7356945d20c6d86dea137ff796335da9800370d4 100644 (file)
@@ -6,7 +6,8 @@ by noseplugin.NoseSQLAlchemy.
 
 """
 
-from sqlalchemy.test import testing, engines, requires, profiling, pickleable, config
+from sqlalchemy_nose import config
+from sqlalchemy.test import testing, engines, requires, profiling, pickleable
 from sqlalchemy.test.schema import Column, Table
 from sqlalchemy.test.testing import \
      AssertsCompiledSQL, \
index 9e77f38d718d29a4fcbba737d31766b72a5ecba7..870f984ecfdddf0b09b58d958df0ee54804ad5dc 100644 (file)
@@ -1,6 +1,6 @@
 import sys, types, weakref
 from collections import deque
-import config
+from sqlalchemy_nose import config
 from sqlalchemy.util import function_named, callable
 import re
 import warnings
index c5256affa48c517ba76a7fefbdf984420ce979f8..835253a3a923dda692a0b924a1d6fccfe1097946 100644 (file)
@@ -6,7 +6,7 @@ in a more fine-grained way than nose's profiling plugin.
 """
 
 import os, sys
-from sqlalchemy.test import config
+from sqlalchemy_nose import config
 from sqlalchemy.test.util import function_named, gc_collect
 from nose import SkipTest
 
index 41ba3038f2e45dc42e55c02ec65153daba4deca3..471044742f97ed54134fec4553556a0487e1f070 100644 (file)
@@ -8,7 +8,8 @@ import types
 import warnings
 from cStringIO import StringIO
 
-from sqlalchemy.test import config, assertsql, util as testutil
+from sqlalchemy_nose import config
+from sqlalchemy.test import assertsql, util as testutil
 from sqlalchemy.util import function_named, py3k
 from engines import drop_all_tables
 
diff --git a/lib/sqlalchemy_nose/__init__.py b/lib/sqlalchemy_nose/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
similarity index 96%
rename from lib/sqlalchemy/test/noseplugin.py
rename to lib/sqlalchemy_nose/noseplugin.py
index 6a3106e69ddd34593809adc957ff1a1a0c99bab7..8732142f7d323f8e107da2805c2e1c71ed5deec5 100644 (file)
@@ -10,9 +10,9 @@ import StringIO
 import nose.case
 from nose.plugins import Plugin
 
-from sqlalchemy import util, log as sqla_log
-from sqlalchemy.test import testing, config, requires
-from sqlalchemy.test.config import (
+from sqlalchemy_nose import config
+
+from sqlalchemy_nose.config import (
     _create_testing_engine, _engine_pool, _engine_strategy, _engine_uri, _list_dbs, _log,
     _prep_testing_database, _require, _reverse_topological, _server_side_cursors,
     _set_table_options, base_config, db, db_label, db_url, file_config, post_configure)
@@ -78,6 +78,10 @@ class NoseSQLAlchemy(Plugin):
         self.options = options
         
     def begin(self):
+        global testing, requires, util
+        from sqlalchemy.test import testing, requires
+        from sqlalchemy import util
+        
         testing.db = db
         testing.requires = requires
 
index 76cba05845a4686df30961c73109c5565f65cbf9..7a8a0f3f26495ded6eab188ea8694b2388c18ccf 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -56,11 +56,11 @@ elif BUILD_CEXTENSIONS:
 
 def find_packages(dir_):
     packages = []
-    for _dir, subdirectories, files in os.walk(os.path.join(dir_,
-            'sqlalchemy')):
-        if '__init__.py' in files:
-            lib, fragment = _dir.split(os.sep, 1)
-            packages.append(fragment.replace(os.sep, '.'))
+    for pkg in ['sqlalchemy', 'sqlalchemy_nose']:
+        for _dir, subdirectories, files in os.walk(os.path.join(dir_, pkg)):
+            if '__init__.py' in files:
+                lib, fragment = _dir.split(os.sep, 1)
+                packages.append(fragment.replace(os.sep, '.'))
     return packages
 
 if sys.version_info < (2, 4):
@@ -90,7 +90,7 @@ setup(name = "SQLAlchemy",
       test_suite = "nose.collector",
       entry_points = {
           'nose.plugins.0.10': [
-              'sqlalchemy = sqlalchemy.test.noseplugin:NoseSQLAlchemy',
+              'sqlalchemy = sqlalchemy_nose.noseplugin:NoseSQLAlchemy',
               ]
           },
       
index 8b137891791fe96927ad78e64b0aad7bded08bdc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-