Doing some simple cleanup.
This commit is contained in:
@@ -27,7 +27,7 @@ class TestTemplateBuilds(unittest.TestCase):
|
|||||||
@unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
|
@unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
|
||||||
@unittest.skipUnless(
|
@unittest.skipUnless(
|
||||||
getattr(pecan, '__run_all_tests__', False) is True,
|
getattr(pecan, '__run_all_tests__', False) is True,
|
||||||
'Skipping (really slow). To run, `$ python setup.py test --slow.`'
|
'Skipping (really slow). To run, `$ python setup.py test --functional.`'
|
||||||
)
|
)
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
# Make a temp install location and record the cwd
|
# Make a temp install location and record the cwd
|
||||||
@@ -50,23 +50,23 @@ class TestTemplateBuilds(unittest.TestCase):
|
|||||||
# chdir into the pecan source
|
# chdir into the pecan source
|
||||||
os.chdir(pkg_resources.get_distribution('pecan').location)
|
os.chdir(pkg_resources.get_distribution('pecan').location)
|
||||||
|
|
||||||
py = os.path.join(cls.install_dir, 'bin', 'python')
|
py_exe = os.path.join(cls.install_dir, 'bin', 'python')
|
||||||
pecan_ = os.path.join(cls.install_dir, 'bin', 'pecan')
|
pecan_exe = os.path.join(cls.install_dir, 'bin', 'pecan')
|
||||||
|
|
||||||
# env/bin/python setup.py develop (pecan)
|
# env/bin/python setup.py develop (pecan)
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
py,
|
py_exe,
|
||||||
'setup.py',
|
'setup.py',
|
||||||
'develop'
|
'develop'
|
||||||
])
|
])
|
||||||
# create the templated project
|
# create the templated project
|
||||||
os.chdir(cls.install_dir)
|
os.chdir(cls.install_dir)
|
||||||
subprocess.check_call([pecan_, 'create', 'Testing123'])
|
subprocess.check_call([pecan_exe, 'create', 'Testing123'])
|
||||||
|
|
||||||
# move into the new project directory and install
|
# move into the new project directory and install
|
||||||
os.chdir('Testing123')
|
os.chdir('Testing123')
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
py,
|
py_exe,
|
||||||
'setup.py',
|
'setup.py',
|
||||||
'develop'
|
'develop'
|
||||||
])
|
])
|
||||||
@@ -85,11 +85,11 @@ class TestTemplateBuilds(unittest.TestCase):
|
|||||||
|
|
||||||
@unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
|
@unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
|
||||||
def test_project_pecan_serve_command(self):
|
def test_project_pecan_serve_command(self):
|
||||||
pecan_ = os.path.join(self.__class__.install_dir, 'bin', 'pecan')
|
pecan_exe = os.path.join(self.__class__.install_dir, 'bin', 'pecan')
|
||||||
|
|
||||||
# Start the server
|
# Start the server
|
||||||
proc = subprocess.Popen([
|
proc = subprocess.Popen([
|
||||||
pecan_,
|
pecan_exe,
|
||||||
'serve',
|
'serve',
|
||||||
'config.py'
|
'config.py'
|
||||||
])
|
])
|
||||||
@@ -109,11 +109,11 @@ class TestTemplateBuilds(unittest.TestCase):
|
|||||||
@unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
|
@unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
|
||||||
def test_project_pecan_shell_command(self):
|
def test_project_pecan_shell_command(self):
|
||||||
from pecan.testing import load_test_app
|
from pecan.testing import load_test_app
|
||||||
pecan_ = os.path.join(self.__class__.install_dir, 'bin', 'pecan')
|
pecan_exe = os.path.join(self.__class__.install_dir, 'bin', 'pecan')
|
||||||
|
|
||||||
# Start the server
|
# Start the server
|
||||||
proc = subprocess.Popen([
|
proc = subprocess.Popen([
|
||||||
pecan_,
|
pecan_exe,
|
||||||
'shell',
|
'shell',
|
||||||
'config.py'
|
'config.py'
|
||||||
],
|
],
|
||||||
@@ -136,11 +136,11 @@ class TestTemplateBuilds(unittest.TestCase):
|
|||||||
|
|
||||||
@unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
|
@unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
|
||||||
def test_project_tests_command(self):
|
def test_project_tests_command(self):
|
||||||
py = os.path.join(self.__class__.install_dir, 'bin', 'python')
|
py_exe = os.path.join(self.__class__.install_dir, 'bin', 'python')
|
||||||
|
|
||||||
# Run the tests
|
# Run the tests
|
||||||
proc = subprocess.Popen([
|
proc = subprocess.Popen([
|
||||||
py,
|
py_exe,
|
||||||
'setup.py',
|
'setup.py',
|
||||||
'test'
|
'test'
|
||||||
],
|
],
|
||||||
|
|||||||
6
setup.py
6
setup.py
@@ -31,15 +31,15 @@ tests_require = requirements + ['virtualenv']
|
|||||||
class test(TestCommand):
|
class test(TestCommand):
|
||||||
|
|
||||||
user_options = TestCommand.user_options + [
|
user_options = TestCommand.user_options + [
|
||||||
('slow', None, 'Run all tests (even the really slow functional ones)')
|
('functional', None, 'Run all tests (even the really slow functional ones)')
|
||||||
]
|
]
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
self.slow = None
|
self.functional = None
|
||||||
return TestCommand.initialize_options(self)
|
return TestCommand.initialize_options(self)
|
||||||
|
|
||||||
def finalize_options(self):
|
def finalize_options(self):
|
||||||
if self.slow:
|
if self.functional:
|
||||||
import pecan; setattr(pecan, '__run_all_tests__', True)
|
import pecan; setattr(pecan, '__run_all_tests__', True)
|
||||||
return TestCommand.finalize_options(self)
|
return TestCommand.finalize_options(self)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user