documentating release and making small documentation tweaks 0.1.5
authorDaniel Greenfeld <pydanny@gmail.com>
Tue, 20 May 2014 16:00:52 +0000 (09:00 -0700)
committerDaniel Greenfeld <pydanny@gmail.com>
Tue, 20 May 2014 16:00:52 +0000 (09:00 -0700)
.travis.yml
cached_property.py
setup.py
tests/test_cached_property.py

index f96c7ce0562f1381a8822e732a4ef83be4c40ffc..1bc0445d338fd88ffae90fce1d0ef8ef19b79db0 100644 (file)
@@ -3,6 +3,7 @@
 language: python
 
 python:
+  - "3.4"
   - "3.3"
   - "2.7"
   - "2.6"
index 46bcef7ffa145d915a16bc529191f9d3ea690301..c07f5089855fab4e26627aa0ac893d0349f9c96f 100644 (file)
@@ -2,10 +2,9 @@
 
 __author__ = 'Daniel Greenfeld'
 __email__ = 'pydanny@gmail.com'
-__version__ = '0.1.4'
+__version__ = '0.1.5'
 __license__ = 'BSD'
 
-import time
 import threading
 
 
@@ -45,4 +44,4 @@ class threaded_cached_property(cached_property):
                 return obj.__dict__[prop_name]
 
             # If not, do the calculation and release the lock.
-            return super(threaded_cached_property, self).__get__(obj, cls)
\ No newline at end of file
+            return super(threaded_cached_property, self).__get__(obj, cls)
index a6c71d53c86c7c6f48ad7c35fa17263c86c7e750..c162703cefb86878723433f21d2d0b03b3e75301 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ try:
 except ImportError:
     from distutils.core import setup
 
-__version__ = '0.1.4'
+__version__ = '0.1.5'
 
 readme = open('README.rst').read()
 history = open('HISTORY.rst').read().replace('.. :changelog:', '')
@@ -44,5 +44,6 @@ setup(
         'Programming Language :: Python :: 2.7',
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.3',
+        'Programming Language :: Python :: 3.4',
     ],
 )
index 98357381f34317ae3643076845a211aa42d0af6f..e836386224042a434b459e8b0c45af7a9e379602 100755 (executable)
@@ -87,7 +87,9 @@ class TestCachedProperty(unittest.TestCase):
 class TestThreadingIssues(unittest.TestCase):
 
     def test_threads(self):
-        """ How well does this implementation work with threads?"""
+        """ How well does the standard cached_property implementation work with threads?
+            Short answer: It doesn't! Use threaded_cached_property instead!
+        """
 
         class Check(object):
 
@@ -114,12 +116,9 @@ class TestThreadingIssues(unittest.TestCase):
         for thread in threads:
             thread.join()
 
-        # TODO: This assertion should be working.
-        # See https://github.com/pydanny/cached-property/issues/6
-        # self.assertEqual(c.add_cached, 1)
+        # Threads means that caching is bypassed.
+        self.assertNotEqual(c.add_cached, 1)
 
-        # TODO: This assertion should be failing.
-        # See https://github.com/pydanny/cached-property/issues/6
         # This assertion hinges on the fact the system executing the test can
         # spawn and start running num_threads threads within the sleep period
         # (defined in the Check class as 1 second). If num_threads were to be