-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
… rst2rst.tests.packaging ; some PEP8-related changes.
- Loading branch information
1 parent
f2516cc
commit 3c751ad
Showing
5 changed files
with
51 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
"""rst2rst tests.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Tests around project's distribution and packaging.""" | ||
import unittest | ||
|
||
|
||
class PEP396TestCase(unittest.TestCase): | ||
"""Check's PEP 396 compliance, i.e. package's __version__ attribute.""" | ||
def get_version(self): | ||
"""Return rst2rst.__version__.""" | ||
from rst2rst import __version__ | ||
return __version__ | ||
|
||
def test_version_present(self): | ||
"""Check that rst2rst.__version__ exists.""" | ||
try: | ||
self.get_version() | ||
except ImportError: | ||
self.fail('rst2rst package has no attribute __version__.') | ||
|
||
def test_version_match(self): | ||
"""Check that rst2rst.__version__ matches pkg_resources information.""" | ||
try: | ||
import pkg_resources | ||
except ImportError: | ||
self.fail('Cannot import pkg_resources module. It is part of ' | ||
'setuptools, which is a dependency of rst2rst.') | ||
installed_version = pkg_resources.get_distribution('rst2rst').version | ||
self.assertEqual(installed_version, self.get_version(), | ||
'Version mismatch: version.txt tells "%s" whereas ' | ||
'pkg_resources tells "%s". ' | ||
'YOU MAY NEED TO RUN ``make update`` to update the ' | ||
'installed version in development environment.' | ||
% (self.get_version(), installed_version)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters