summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Stewart <alex@foogod.com>2010-09-01 10:50:10 -0700
committerAlex Stewart <alex@foogod.com>2010-09-01 10:50:10 -0700
commitb98f0b1e46bfa4a2f11012d1c2d28caf59163864 (patch)
tree087b75aa65da004da459f61d603d0191b002ff92
parent4f8f0086e245a554c1c8f1ea9a6371a42b907eaf (diff)
downloadnose-b98f0b1e46bfa4a2f11012d1c2d28caf59163864.tar.gz
Moved 3.x test build directories to build/tests instead of build/lib so it doesn't get included in eggs, etc.
-rw-r--r--selftest.py15
-rw-r--r--setup.py3
-rw-r--r--setup3lib.py2
3 files changed, 12 insertions, 8 deletions
diff --git a/selftest.py b/selftest.py
index 6493f3a..436e773 100644
--- a/selftest.py
+++ b/selftest.py
@@ -29,21 +29,26 @@ import sys
if __name__ == "__main__":
this_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
+ lib_dir = this_dir
if sys.version_info >= (3,):
# Under Python 3.x, we need to 'build' the source (using 2to3, etc)
- # first, so it will be located under build/lib/nose instead of this
- # dir.
- this_dir = os.path.join(this_dir, 'build', 'lib')
+ # first. 'python3 setup.py build_tests' will put everything under
+ # build/tests (including nose itself, since some tests are inside the
+ # nose source), so we'll run from that directory instead.
+ lib_dir = os.path.join(this_dir, 'build', 'lib')
+ this_dir = os.path.join(this_dir, 'build', 'tests')
+ if not os.path.isdir(this_dir):
+ raise AssertionError("Error: %s does not exist. Use the setup.py 'build_tests' command to create it." % (this_dir,))
try:
import pkg_resources
- env = pkg_resources.Environment(search_path=[this_dir])
+ env = pkg_resources.Environment(search_path=[lib_dir])
distributions = env["nose"]
assert len(distributions) == 1
dist = distributions[0]
dist.activate()
except ImportError:
pass
- # Always make sure our chosen version is first on the path
+ # Always make sure our chosen test dir is first on the path
sys.path.insert(0, this_dir)
os.chdir(this_dir)
import nose
diff --git a/setup.py b/setup.py
index 37df51f..d7a2b0a 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ import os
VERSION = '0.11.4'
py_vers_tag = '-%s.%s' % sys.version_info[:2]
-test_dirs = ['functional_tests', 'unit_tests', os.path.join('doc','doc_tests')]
+test_dirs = ['functional_tests', 'unit_tests', os.path.join('doc','doc_tests'), 'nose']
try:
from setup3lib import setup
@@ -25,7 +25,6 @@ try:
use_2to3 = True,
test_dirs = test_dirs,
# The following is needed for the ispackage doctests to work right:
- test_build_dir = "build/lib",
pyversion_patching = True,
)
diff --git a/setup3lib.py b/setup3lib.py
index c73a3e5..8c024bf 100644
--- a/setup3lib.py
+++ b/setup3lib.py
@@ -79,7 +79,7 @@ else:
test_base = self.distribution.test_build_dir
if not test_base:
bcmd = self.get_finalized_command('build')
- test_base = bcmd.build_base
+ test_base = os.path.join(bcmd.build_base, 'tests')
self.test_base = test_base
def run(self):