summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-12-11 21:48:13 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-12-11 21:48:13 (GMT)
commita7d81270ccb5af4a1c514f267db5295c6d313e15 (patch)
tree95483d6a2f521e5146e33ab3a65ba8d82c6eba2c
parentd3ded40a53df40c5dd9c1fd05c886bfe91df4aee (diff)
downloadcpython-a7d81270ccb5af4a1c514f267db5295c6d313e15.zip
cpython-a7d81270ccb5af4a1c514f267db5295c6d313e15.tar.gz
cpython-a7d81270ccb5af4a1c514f267db5295c6d313e15.tar.bz2
Issue #25755: Move PropertyWritableDoc into the test case
This fixes a test failure in refleak mode because test_property_decorator_doc_writable no longer modifies the class in module level. Initial patch by Nan Wu and Torsten Landschoff (from issue 25757)
-rw-r--r--Lib/test/test_property.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_property.py b/Lib/test/test_property.py
index 5addd36..26b7d52 100644
--- a/Lib/test/test_property.py
+++ b/Lib/test/test_property.py
@@ -76,13 +76,6 @@ class PropertyNewGetter(object):
"""new docstring"""
return 8
-class PropertyWritableDoc(object):
-
- @property
- def spam(self):
- """Eggs"""
- return "eggs"
-
class PropertyTests(unittest.TestCase):
def test_property_decorator_baseclass(self):
# see #1620
@@ -168,6 +161,13 @@ class PropertyTests(unittest.TestCase):
@unittest.skipIf(sys.flags.optimize >= 2,
"Docstrings are omitted with -O2 and above")
def test_property_decorator_doc_writable(self):
+ class PropertyWritableDoc(object):
+
+ @property
+ def spam(self):
+ """Eggs"""
+ return "eggs"
+
sub = PropertyWritableDoc()
self.assertEqual(sub.__class__.spam.__doc__, 'Eggs')
sub.__class__.spam.__doc__ = 'Spam'