Commit ab03eb16 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.29.x'

parents 5eb78ca9 6a573cd8
""" """
>>> import sys
>>> ONE, TEN, HUNDRED >>> ONE, TEN, HUNDRED
(1, 10, 100) (1, 10, 100)
>>> THOUSAND # doctest: +ELLIPSIS >>> THOUSAND # doctest: +ELLIPSIS
...@@ -41,8 +43,10 @@ NameError: ...name 'RANK_3' is not defined ...@@ -41,8 +43,10 @@ NameError: ...name 'RANK_3' is not defined
>>> set(PyxEnum) == {TWO, THREE, FIVE} >>> set(PyxEnum) == {TWO, THREE, FIVE}
True True
>>> str(PyxEnum.TWO).split(".")[-1] # Py3.10 changed the output here >>> str(PyxEnum.TWO).split(".")[-1] if sys.version_info < (3,11) else "TWO" # Py3.10/11 changed the output here
'TWO' 'TWO'
>>> str(PyxEnum.TWO) if sys.version_info >= (3,11) else "2" # Py3.10/11 changed the output here
'2'
>>> PyxEnum.TWO + PyxEnum.THREE == PyxEnum.FIVE >>> PyxEnum.TWO + PyxEnum.THREE == PyxEnum.FIVE
True True
>>> PyxEnum(2) is PyxEnum["TWO"] is PyxEnum.TWO >>> PyxEnum(2) is PyxEnum["TWO"] is PyxEnum.TWO
......
# mode: run
class Foo: class Foo:
@property @property
def foo(self): def foo(self):
...@@ -36,6 +38,6 @@ def wrap_hasattr(obj, name): ...@@ -36,6 +38,6 @@ def wrap_hasattr(obj, name):
>>> hasattr(Foo(), None) #doctest: +ELLIPSIS >>> hasattr(Foo(), None) #doctest: +ELLIPSIS
Traceback (most recent call last): Traceback (most recent call last):
... ...
TypeError: hasattr(): attribute name must be string TypeError: ...attribute name must be string...
""" """
return hasattr(obj, name) return hasattr(obj, name)
...@@ -1481,7 +1481,7 @@ class UnicodeTest(CommonTest, ...@@ -1481,7 +1481,7 @@ class UnicodeTest(CommonTest,
self.assertEqual(('...%(foo)s...' % {'foo':Str.ABC}).replace("Str.", ""), self.assertEqual(('...%(foo)s...' % {'foo':Str.ABC}).replace("Str.", ""),
'...ABC...') '...ABC...')
self.assertEqual(('...%(foo)s...' % {'foo':Int.IDES}).replace("Int.", ""), self.assertEqual(('...%(foo)s...' % {'foo':Int.IDES}).replace("Int.", ""),
'...IDES...') '...IDES...' if sys.version_info < (3,11) else '...15...')
self.assertEqual('...%(foo)i...' % {'foo':Int.IDES}, self.assertEqual('...%(foo)i...' % {'foo':Int.IDES},
'...15...') '...15...')
self.assertEqual('...%(foo)d...' % {'foo':Int.IDES}, self.assertEqual('...%(foo)d...' % {'foo':Int.IDES},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment