]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
first step of [ticket:1949], remove the setuptools aspect
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Nov 2010 00:25:34 +0000 (19:25 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Nov 2010 00:25:34 +0000 (19:25 -0500)
of the plugin, move it to test/bootstrap

README.py3k
README.unittests
lib/sqlalchemy/test/__init__.py
lib/sqlalchemy/test/engines.py
lib/sqlalchemy/test/profiling.py
lib/sqlalchemy/test/testing.py
setup.py
sqla_nose.py
test/bootstrap/__init__.py [moved from lib/sqlalchemy_nose/__init__.py with 100% similarity]
test/bootstrap/config.py [moved from lib/sqlalchemy_nose/config.py with 100% similarity]
test/bootstrap/noseplugin.py [moved from lib/sqlalchemy_nose/noseplugin.py with 98% similarity]

index 95ecb7f3afa9adcf2dcb04aac68671a66438b6f2..b69fe3d2ce4f04521b5e66714a94c9b37e7d47d6 100644 (file)
@@ -39,17 +39,9 @@ The above will rewrite all files in-place in Python 3 format.
 Running Tests
 -------------
 
-To run the unit tests, ensure Distribute is installed as above,
-and also that at least the ./lib/ and ./test/ directories have been converted
-to Python 3 using the source tool above.   A Python 3 version of Nose
-can be acquired from Bitbucket using Mercurial:
-
-    hg clone http://bitbucket.org/jpellerin/nose3/
-    cd nose3
-    python3 setup.py install
-
-The tests can then be run using the "nosetests3" script installed by the above,
-using the same instructions in README.unittests.
+To run unit tests in Py3k, Nose 1.0 is required, or a development
+version of Nose that supports Python 3.   The tests are run
+using ./sqla_nose.py as described in README.unittests.
 
 Current 3k Issues
 -----------------
index 6b2320907def973832b7f2b31264a5cc97da8f7b..6c4353b35a30b7d54d5582c64f13e4dbb407b3e2 100644 (file)
@@ -16,48 +16,25 @@ Or using setuptools:
     $ easy_install nose
 
 SQLAlchemy implements a nose plugin that must be present when tests are run.
-This plugin is available when SQLAlchemy is installed via setuptools.
+This plugin is invoked when the test runner script provided with
+SQLAlchemy is used.
 
-INSTANT TEST RUNNER
--------------------
-
-A plain vanilla run of all tests using sqlite can be run via setup.py:
-
-    $ python setup.py test
-    
-(NOTE: this command is broken for Python 2.7 with nose 0.11.3, see 
-Nose issue 340.  You will need to use 'nosetests' directly, see below.)
-    
-Setuptools will take care of the rest !   To run nose directly and have
-its full set of options available, read on...
-
-SETUP
------
-
-All that's required is for SQLAlchemy to be installed via setuptools.
-For example, to create a local install in a source distribution directory:
-
-    $ export PYTHONPATH=.
-    $ python setup.py develop -d .
-
-The above will create a setuptools "development" distribution in the local
-path, which allows the Nose plugin to be available when nosetests is run.
-The plugin is enabled using the "with-sqlalchemy=True" configuration
-in setup.cfg.
+**NOTE:** - the nose plugin is no longer installed by setuptools as of 
+version 0.7 !  Please use sqla_nose.py to run tests.
 
 RUNNING ALL TESTS
 -----------------
 To run all tests:
 
-    $ nosetests
+    $ ./sqla_nose.py
 
 (NOTE: if running with Python 2.7 and nose 0.11.3, add "-w test/" to the command.
 Again this is a Nose issue, see Nose issue 342.)
 
 If you're running the tests on Microsoft Windows, then there is an additional
-argument that must be passed to nosetests:
+argument that must be passed to ./sqla_nose.py:
 
-    > nosetests --first-package-wins=True
+    > ./sqla_nose.py --first-package-wins=True
 
 This is required because nose’s importer will normally evict a package from
 sys.modules if it sees a package with the same name in a different location.
@@ -66,39 +43,29 @@ Setting this argument disables that behavior.
 Assuming all tests pass, this is a very unexciting output.  To make it more 
 intersesting:
 
-    $ nosetests -v
-
-ALTERNATE TEST RUNNER
----------------------
-
-The script "sqla_nose.py" is a front-end to Nose which manually associates
-the SQLAlchemy testing plugin with Nose at runtime.   This script can run the 
-tests without any reliance upon setuptools.   In 0.7 we'll be removing the 
-Nose plugin from setup, so this will be the way going forward to run tests:
-
-    $ python sqla_nose.py -v
+    $ ./sqla_nose.py -v
 
 RUNNING INDIVIDUAL TESTS
 -------------------------
 Any directory of test modules can be run at once by specifying the directory
 path:
 
-    $ nosetest test/dialect
+    $ ./sqla_nose.py test/dialect
 
 Any test module can be run directly by specifying its module name:
 
-    $ nosetests test.orm.test_mapper
+    $ ./sqla_nose.py test.orm.test_mapper
 
 To run a specific test within the module, specify it as module:ClassName.methodname:
 
-    $ nosetests test.orm.test_mapper:MapperTest.test_utils
+    $ ./sqla_nose.py test.orm.test_mapper:MapperTest.test_utils
 
 
 COMMAND LINE OPTIONS
 --------------------
 Help is available via --help:
 
-    $ nosetests --help
+    $ ./sqla_nose.py --help
 
 The --help screen is a combination of common nose options and options which 
 the SQLAlchemy nose plugin adds.  The most commonly SQLAlchemy-specific 
@@ -186,7 +153,7 @@ Additional steps specific to individual databases are as follows:
 If you'll be running the tests frequently, database aliases can save a lot of
 typing.  The --dbs option lists the built-in aliases and their matching URLs:
 
-    $ nosetests --dbs
+    $ ./sqla_nose.py --dbs
     Available --db options (use --dburi to override)
                mysql    mysql://scott:tiger@127.0.0.1:3306/test
               oracle    oracle://scott:tiger@127.0.0.1:1521
@@ -195,7 +162,7 @@ typing.  The --dbs option lists the built-in aliases and their matching URLs:
 
 To run tests against an aliased database:
 
-    $ nosetests --db=postgresql
+    $ ./sqla_nose.py --db=postgresql
 
 To customize the URLs with your own users or hostnames, make a simple .ini
 file called `test.cfg` at the top level of the SQLAlchemy source distribution
@@ -213,7 +180,7 @@ SQLAlchemy logs its activity and debugging through Python's logging package.
 Any log target can be directed to the console with command line options, such
 as:
 
-    $ nosetests test.orm.unitofwork --log-info=sqlalchemy.orm.mapper \
+    $ ./sqla_nose.py test.orm.unitofwork --log-info=sqlalchemy.orm.mapper \
       --log-debug=sqlalchemy.pool --log-info=sqlalchemy.engine
 
 This would log mapper configuration, connection pool checkouts, and SQL
@@ -225,7 +192,7 @@ BUILT-IN COVERAGE REPORTING
 Coverage is tracked using Nose's coverage plugin.   See the nose 
 documentation for details.  Basic usage is:
 
-    $ nosetests test.sql.test_query --with-coverage
+    $ ./sqla_nose.py test.sql.test_query --with-coverage
 
 BIG COVERAGE TIP !!!  There is an issue where existing .pyc files may
 store the incorrect filepaths, which will break the coverage system.  If
index 7356945d20c6d86dea137ff796335da9800370d4..e82b3ac9145836927e7ca7bf372d4ad4aaef3d7a 100644 (file)
@@ -6,7 +6,7 @@ by noseplugin.NoseSQLAlchemy.
 
 """
 
-from sqlalchemy_nose import config
+from test.bootstrap import config
 from sqlalchemy.test import testing, engines, requires, profiling, pickleable
 from sqlalchemy.test.schema import Column, Table
 from sqlalchemy.test.testing import \
index 870f984ecfdddf0b09b58d958df0ee54804ad5dc..d18b8c8cf3bf589c918528cbde8a14aaa81a04e9 100644 (file)
@@ -1,6 +1,6 @@
 import sys, types, weakref
 from collections import deque
-from sqlalchemy_nose import config
+from test.bootstrap import config
 from sqlalchemy.util import function_named, callable
 import re
 import warnings
index 835253a3a923dda692a0b924a1d6fccfe1097946..6f839897d95dec3a8e367cef4ae9d4bc2589f4c4 100644 (file)
@@ -6,7 +6,6 @@ in a more fine-grained way than nose's profiling plugin.
 """
 
 import os, sys
-from sqlalchemy_nose import config
 from sqlalchemy.test.util import function_named, gc_collect
 from nose import SkipTest
 
index 12cbe5e029c6e87693ec47c97bfd6cb1fa540b3f..46723baa0471dcc2188b3398cf47a842c0b484eb 100644 (file)
@@ -8,7 +8,7 @@ import types
 import warnings
 from cStringIO import StringIO
 
-from sqlalchemy_nose import config
+from test.bootstrap import config
 from sqlalchemy.test import assertsql, util as testutil
 from sqlalchemy.util import function_named, py3k
 from engines import drop_all_tables
index 7a8a0f3f26495ded6eab188ea8694b2388c18ccf..0e9b18c665db1f281fcd27d29dc5cce925cac1d1 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -56,7 +56,7 @@ elif BUILD_CEXTENSIONS:
 
 def find_packages(dir_):
     packages = []
-    for pkg in ['sqlalchemy', 'sqlalchemy_nose']:
+    for pkg in ['sqlalchemy']:
         for _dir, subdirectories, files in os.walk(os.path.join(dir_, pkg)):
             if '__init__.py' in files:
                 lib, fragment = _dir.split(os.sep, 1)
@@ -88,11 +88,6 @@ setup(name = "SQLAlchemy",
 
       tests_require = ['nose >= 0.11'],
       test_suite = "nose.collector",
-      entry_points = {
-          'nose.plugins.0.10': [
-              'sqlalchemy = sqlalchemy_nose.noseplugin:NoseSQLAlchemy',
-              ]
-          },
       
       long_description = """\
 SQLAlchemy is:
index 302fb5b08712d7d74366e0eb55c0bee126227f86..6482958cba3cbcf5dfdd4862b218355f29841c17 100755 (executable)
@@ -8,12 +8,11 @@ require that SQLA's testing plugin be installed via setuptools.
 """
 import sys
 
-try:
-    from sqlalchemy_nose.noseplugin import NoseSQLAlchemy
-except ImportError:
-    from os import path
-    sys.path.append(path.join(path.dirname(path.abspath(__file__)), 'lib'))
-    from sqlalchemy_nose.noseplugin import NoseSQLAlchemy
+from os import path
+for pth in ['.', './lib']:
+    sys.path.insert(0, path.join(path.dirname(path.abspath(__file__)), pth))
+
+from test.bootstrap.noseplugin import NoseSQLAlchemy
 
 import nose
 
similarity index 98%
rename from lib/sqlalchemy_nose/noseplugin.py
rename to test/bootstrap/noseplugin.py
index 8732142f7d323f8e107da2805c2e1c71ed5deec5..f010641f68e45d2e5afc8af4b0ee796bd5c3871f 100644 (file)
@@ -10,9 +10,9 @@ import StringIO
 import nose.case
 from nose.plugins import Plugin
 
-from sqlalchemy_nose import config
+from test.bootstrap import config
 
-from sqlalchemy_nose.config import (
+from test.bootstrap.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)