mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Backport METH_FASTCALL from Python 3.7 (#328)
This commit is contained in:
parent
70c97f598b
commit
cf73bbd678
102 changed files with 2896 additions and 3301 deletions
17
third_party/python/Lib/test/test_property.py
vendored
17
third_party/python/Lib/test/test_property.py
vendored
|
@ -2,6 +2,7 @@
|
|||
# more tests are in test_descr
|
||||
|
||||
import sys
|
||||
import cosmo
|
||||
import unittest
|
||||
from test import support
|
||||
|
||||
|
@ -100,13 +101,13 @@ class PropertyTests(unittest.TestCase):
|
|||
self.assertRaises(PropertySet, setattr, sub, "spam", None)
|
||||
self.assertRaises(PropertyDel, delattr, sub, "spam")
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
@unittest.skipIf(sys.flags.optimize >= 2 or cosmo.MODE == 'tiny',
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_property_decorator_subclass_doc(self):
|
||||
sub = SubClass()
|
||||
self.assertEqual(sub.__class__.spam.__doc__, "SubClass.getter")
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
@unittest.skipIf(sys.flags.optimize >= 2 or cosmo.MODE == 'tiny',
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_property_decorator_baseclass_doc(self):
|
||||
base = BaseClass()
|
||||
|
@ -118,7 +119,7 @@ class PropertyTests(unittest.TestCase):
|
|||
self.assertEqual(base.__class__.spam.__doc__, "spam spam spam")
|
||||
self.assertEqual(sub.__class__.spam.__doc__, "spam spam spam")
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
@unittest.skipIf(sys.flags.optimize >= 2 or cosmo.MODE == 'tiny',
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_property_getter_doc_override(self):
|
||||
newgettersub = PropertySubNewGetter()
|
||||
|
@ -151,7 +152,7 @@ class PropertyTests(unittest.TestCase):
|
|||
foo = property(foo)
|
||||
C.foo.__isabstractmethod__
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
@unittest.skipIf(sys.flags.optimize >= 2 or cosmo.MODE == 'tiny',
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_property_builtin_doc_writable(self):
|
||||
p = property(doc='basic')
|
||||
|
@ -159,7 +160,7 @@ class PropertyTests(unittest.TestCase):
|
|||
p.__doc__ = 'extended'
|
||||
self.assertEqual(p.__doc__, 'extended')
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
@unittest.skipIf(sys.flags.optimize >= 2 or cosmo.MODE == 'tiny',
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_property_decorator_doc_writable(self):
|
||||
class PropertyWritableDoc(object):
|
||||
|
@ -206,7 +207,7 @@ class PropertySubclassTests(unittest.TestCase):
|
|||
else:
|
||||
raise Exception("AttributeError not raised")
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
@unittest.skipIf(sys.flags.optimize >= 2 or cosmo.MODE == 'tiny',
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_docstring_copy(self):
|
||||
class Foo(object):
|
||||
|
@ -218,7 +219,7 @@ class PropertySubclassTests(unittest.TestCase):
|
|||
Foo.spam.__doc__,
|
||||
"spam wrapped in property subclass")
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
@unittest.skipIf(sys.flags.optimize >= 2 or cosmo.MODE == 'tiny',
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_property_setter_copies_getter_docstring(self):
|
||||
class Foo(object):
|
||||
|
@ -251,7 +252,7 @@ class PropertySubclassTests(unittest.TestCase):
|
|||
FooSub.spam.__doc__,
|
||||
"spam wrapped in property subclass")
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
@unittest.skipIf(sys.flags.optimize >= 2 or cosmo.MODE == 'tiny',
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_property_new_getter_new_docstring(self):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue