2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 18:52:26 +00:00

doctest tests test_richcmp?.py, make test updated.

[SVN r10662]
This commit is contained in:
Ralf W. Grosse-Kunstleve
2001-07-18 21:33:47 +00:00
parent c7e12ecf3d
commit 9bca6982a4
14 changed files with 187 additions and 97 deletions

41
example/test_richcmp2.py Normal file
View File

@@ -0,0 +1,41 @@
r'''>>> import richcmp2
>>> c1 = richcmp2.code(1)
>>> c2 = richcmp2.code(2)
>>> c3 = richcmp2.code(2)
>>> print c1 == c2
0
>>> print c1 != c2
1
>>> print c2 == c3
1
>>> print c2 != c3
0
>>> print c1 < c2
1
>>> print c1 <= c2
1
>>> print c1 == c2
0
>>> print c1 != c2
1
>>> print c1 > c2
0
>>> print c1 >= c2
0
'''
def run(args = None):
if args is not None:
import sys
sys.argv = args
import doctest, test_richcmp1
return doctest.testmod(test_richcmp1)
if __name__ == '__main__':
import sys
if ( hasattr(sys, 'version_info')
and ( (sys.version_info[0] == 2 and sys.version_info[1] >= 1)
or sys.version_info[0] > 2)):
sys.exit(run()[0])
else:
print "Python version 2.1 or higher required. Test skipped."