summaryrefslogtreecommitdiff
path: root/tests/test_setup.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-02-03 06:35:05 -0500
committerNed Batchelder <ned@nedbatchelder.com>2017-02-03 06:35:05 -0500
commit093bd6e9949770455768a403162f86d54ce31544 (patch)
tree30f6cdf835e6f8ac38605af3de6c9ae17b49fe0e /tests/test_setup.py
parent7e9d046f2f5fd916af8e048f4737e5d68def711b (diff)
downloadpython-coveragepy-git-093bd6e9949770455768a403162f86d54ce31544.tar.gz
Split tests into their own files
Diffstat (limited to 'tests/test_setup.py')
-rw-r--r--tests/test_setup.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/test_setup.py b/tests/test_setup.py
new file mode 100644
index 00000000..6533418a
--- /dev/null
+++ b/tests/test_setup.py
@@ -0,0 +1,47 @@
+# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
+
+"""Tests of miscellaneous stuff."""
+
+import sys
+
+import coverage
+
+from tests.coveragetest import CoverageTest
+
+
+class SetupPyTest(CoverageTest):
+ """Tests of setup.py"""
+
+ run_in_temp_dir = False
+
+ def setUp(self):
+ super(SetupPyTest, self).setUp()
+ # Force the most restrictive interpretation.
+ self.set_environ('LC_ALL', 'C')
+
+ def test_metadata(self):
+ status, output = self.run_command_status(
+ "python setup.py --description --version --url --author"
+ )
+ self.assertEqual(status, 0)
+ out = output.splitlines()
+ self.assertIn("measurement", out[0])
+ self.assertEqual(out[1], coverage.__version__)
+ self.assertEqual(out[2], coverage.__url__)
+ self.assertIn("Ned Batchelder", out[3])
+
+ def test_more_metadata(self):
+ # Let's be sure we pick up our own setup.py
+ # CoverageTest restores the original sys.path for us.
+ sys.path.insert(0, '')
+ from setup import setup_args
+
+ classifiers = setup_args['classifiers']
+ self.assertGreater(len(classifiers), 7)
+ self.assert_starts_with(classifiers[-1], "Development Status ::")
+
+ long_description = setup_args['long_description'].splitlines()
+ self.assertGreater(len(long_description), 7)
+ self.assertNotEqual(long_description[0].strip(), "")
+ self.assertNotEqual(long_description[-1].strip(), "")