[Python-checkins] cpython (merge 3.5 -> default): Issue #25755: Move PropertyWritableDoc into the test case

berker.peksag python-checkins at python.org
Fri Dec 11 16:48:44 EST 2015


https://hg.python.org/cpython/rev/8f52c9d72d9f
changeset:   99533:8f52c9d72d9f
parent:      99531:f8c8441c6cfe
parent:      99532:cc1aa0e88626
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Fri Dec 11 23:48:37 2015 +0200
summary:
  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)

files:
  Lib/test/test_property.py |  14 +++++++-------
  1 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/Lib/test/test_property.py b/Lib/test/test_property.py
--- a/Lib/test/test_property.py
+++ b/Lib/test/test_property.py
@@ -76,13 +76,6 @@
         """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 @@
     @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'

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list