diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-17 09:10:18 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-17 09:10:18 -0500 |
commit | b759d1982be393f5ec21bfc71e5e41ffcc00aeb3 (patch) | |
tree | 3ccb57ad33c4b5836f3cb4d43b45c75da6e99d7b /test/test_process.py | |
parent | 0b921d098a92ac44f648aef7bb20695fe7f1986c (diff) | |
download | python-coveragepy-git-b759d1982be393f5ec21bfc71e5e41ffcc00aeb3.tar.gz |
Create coverage-X.Y aliases also. Closes #111.
Diffstat (limited to 'test/test_process.py')
-rw-r--r-- | test/test_process.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/test_process.py b/test/test_process.py index 4df8860f..2d926038 100644 --- a/test/test_process.py +++ b/test/test_process.py @@ -394,14 +394,28 @@ class ProcessTest(CoverageTest): # about 5. self.assertGreater(data.summary()['os.py'], 50) - def test_version_aliases(self): + +class AliasedCommandTests(CoverageTest): + """Tests of the version-specific command aliases.""" + + def test__major_version_works(self): + # "coverage2" works on py2 cmd = "coverage%d" % sys.version_info[0] out = self.run_command(cmd) self.assertIn("Code coverage for Python", out) + + def test_wrong_alias_doesnt_work(self): + # "coverage3" doesn't work on py2 badcmd = "coverage%d" % (5 - sys.version_info[0]) out = self.run_command(badcmd) self.assertNotIn("Code coverage for Python", out) + def test_specific_alias_works(self): + # "coverage-2.7" works on py2.7 + cmd = "coverage-%d.%d" % sys.version_info[:2] + out = self.run_command(cmd) + self.assertIn("Code coverage for Python", out) + class FailUnderTest(CoverageTest): """Tests of the --fail-under switch.""" |