Commits

ta...@MacZiade  committed 5ba904b

README is a doctest too now

  • Participants
  • Parent commits 93a0233
  • Branches tarek-postdev

Comments (0)

Files changed (3)

     >>> RationalVersion('1.0') > RationalVersion('0.9')
     True
     >>> RationalVersion('1.0') < RationalVersion('1.1')
+    True
 
 A class method called ``from_parts`` is available if you want to create an
 instance by providing the parts that composes the version.
     >>> str(version)
     '1.0'
 
-    >>> version = RationalVersion.from_parts((1, 0), ('c4'))
+    >>> version = RationalVersion.from_parts((1, 0), ('c', 4))
     >>> str(version)
     '1.0c4'
 

File test_verlib.py

 """Tests for distutils.version."""
 import unittest
 import doctest
+import os
 
 from verlib import RationalVersion as V
 from verlib import IrrationalVersionError
         self.assertEquals(suggest('walla walla washington'), None)
 
 def test_suite():
-    return unittest.makeSuite(VersionTestCase)
+    README = os.path.join(os.path.dirname(__file__), 'README.txt')
+    suite = [doctest.DocFileSuite(README), unittest.makeSuite(VersionTestCase)]
+    return unittest.TestSuite(suite)
 
 if __name__ == "__main__":
     unittest.main(defaultTest="test_suite")
+
     @classmethod
     def from_parts(cls, version, prerelease=None, devpost=None):
         if prerelease is None:
-            prerelease = tuple()
+            prerelease = FINAL_MARKER
         if devpost is None:
-            devpost = tuple()
+            devpost = FINAL_MARKER
         return cls(cls.parts_to_str((version, prerelease, devpost)))
 
     def _parse(self, s, error_on_huge_major_num=True):