Commit a974f8c7 authored by Jason R. Coombs's avatar Jason R. Coombs

Use DALS for nicer indentation

parent ee20548e
......@@ -13,37 +13,43 @@ from setuptools.compat import StringIO, PY2
from setuptools.command.test import test
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
from .textwrap import DALS
setup(name='foo',
SETUP_PY = DALS("""
from setuptools import setup
setup(name='foo',
packages=['name', 'name.space', 'name.space.tests'],
namespace_packages=['name'],
test_suite='name.space.tests.test_suite',
)
"""
)
""")
NS_INIT = """# -*- coding: Latin-1 -*-
# Söme Arbiträry Ünicode to test Issüé 310
try:
NS_INIT = DALS("""
# -*- coding: Latin-1 -*-
# Söme Arbiträry Ünicode to test Issüé 310
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
"""
""")
# Make sure this is Latin-1 binary, before writing:
if PY2:
NS_INIT = NS_INIT.decode('UTF-8')
NS_INIT = NS_INIT.encode('Latin-1')
TEST_PY = """import unittest
TEST_PY = DALS("""
import unittest
class TestTest(unittest.TestCase):
class TestTest(unittest.TestCase):
def test_test(self):
print "Foo" # Should fail under Python 3 unless 2to3 is used
test_suite = unittest.makeSuite(TestTest)
"""
test_suite = unittest.makeSuite(TestTest)
""")
class TestTestTest(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment