Commit 9447214e by Chris Jerdonek

Fixed an issue whereby setup.py was not importable when running tox.

parent 0770b896
......@@ -52,6 +52,7 @@ def run_tests(sys_argv):
_PystacheTestProgram._text_doctest_dir = project_dir
_PystacheTestProgram._spec_test_dir = spec_test_dir
SetupTests.project_dir = project_dir
# We pass None for the module because we do not want the unittest
# module to resolve module names relative to a given module.
......@@ -85,13 +86,22 @@ class SetupTests(unittest.TestCase):
"""Tests about setup.py."""
project_dir = None
def test_version(self):
"""
Test that setup.py's version matches the package's version.
"""
from setup import VERSION
self.assertEqual(VERSION, pystache.__version__)
original_path = list(sys.path)
sys.path.insert(0, self.project_dir)
try:
from setup import VERSION
self.assertEqual(VERSION, pystache.__version__)
finally:
sys.path = original_path
# The function unittest.main() is an alias for unittest.TestProgram's
......
......@@ -120,9 +120,6 @@ if sys.argv[-1] == 'publish':
publish()
sys.exit()
long_description = make_long_description()
template_files = ['*.mustache', '*.txt']
# We follow the guidance here for compatibility with using setuptools instead
# of Distribute under Python 2 (on the subject of new, unrecognized keyword
# arguments to setup()):
......@@ -169,6 +166,9 @@ PACKAGES = [
def main(sys_argv):
long_description = make_long_description()
template_files = ['*.mustache', '*.txt']
setup(name='pystache',
version=VERSION,
license='MIT',
......
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