Tweak unit tests
authorGeorge Sakkis <george.sakkis@gmail.com>
Sun, 19 Apr 2015 17:59:04 +0000 (20:59 +0300)
committerGeorge Sakkis <george.sakkis@gmail.com>
Sun, 19 Apr 2015 18:01:01 +0000 (21:01 +0300)
- Fix shadowed Testcase class name in test_cached_property_ttl
- Single Testcase class per cached_property variant.
- Make test modules non-executable.

tests/__init__.py [changed mode: 0755->0644]
tests/test_cached_property.py [changed mode: 0755->0644]
tests/test_cached_property_ttl.py
tests/test_threaded_cached_property.py [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index d39778a..bb40401
@@ -87,9 +87,6 @@ class TestCachedProperty(unittest.TestCase):
         # Run standard cache assertion
         self.assertEqual(c.add_cached, None)
 
-
-class TestThreadingIssues(unittest.TestCase):
-
     def test_threads(self):
         """ How well does the standard cached_property implementation work with threads?
             Short answer: It doesn't! Use threaded_cached_property instead!
index 78e2e2765d0fb0aef62fed79ad1edf01d1dbf5c9..2470d60e7381c34acb50a279a23dbd791d3fae43 100644 (file)
@@ -24,7 +24,7 @@ from freezegun import freeze_time
 from cached_property import cached_property
 
 
-class TestCachedProperty(unittest.TestCase):
+class TestCachedPropertyWithTTL(unittest.TestCase):
 
     def test_cached_property(self):
 
@@ -101,9 +101,6 @@ class TestCachedProperty(unittest.TestCase):
         # Run standard cache assertion
         self.assertEqual(c.add_cached, None)
 
-
-class TestThreadingIssues(unittest.TestCase):
-
     def test_threads(self):
         """ How well does the standard cached_property implementation work with threads?
             Short answer: It doesn't! Use threaded_cached_property instead!
@@ -145,9 +142,6 @@ class TestThreadingIssues(unittest.TestCase):
         # preemption.
         self.assertEqual(c.add_cached, num_threads)
 
-
-class TestCachedPropertyWithTTL(unittest.TestCase):
-
     def test_ttl_expiry(self):
 
         class Check(object):
@@ -172,7 +166,7 @@ class TestCachedPropertyWithTTL(unittest.TestCase):
         self.assertEqual(c.add_cached, 2)
 
 
-class TestCachedProperty(unittest.TestCase):
+class TestThreadedCachedPropertyWithTTL(unittest.TestCase):
 
     def test_cached_property(self):
 
@@ -241,9 +235,6 @@ class TestCachedProperty(unittest.TestCase):
         # Run standard cache assertion
         self.assertEqual(c.add_cached, None)
 
-
-class TestThreadingIssues(unittest.TestCase):
-
     def test_threads(self):
         """ How well does this implementation work with threads?"""
 
@@ -271,4 +262,4 @@ class TestThreadingIssues(unittest.TestCase):
         for thread in threads:
             thread.join()
 
-        self.assertEqual(c.add_cached, 1)
\ No newline at end of file
+        self.assertEqual(c.add_cached, 1)
old mode 100755 (executable)
new mode 100644 (file)
index 0d87673..aa4898c
@@ -13,7 +13,7 @@ import unittest
 from cached_property import threaded_cached_property
 
 
-class TestCachedProperty(unittest.TestCase):
+class TestThreadedCachedProperty(unittest.TestCase):
 
     def test_cached_property(self):
 
@@ -82,9 +82,6 @@ class TestCachedProperty(unittest.TestCase):
         # Run standard cache assertion
         self.assertEqual(c.add_cached, None)
 
-
-class TestThreadingIssues(unittest.TestCase):
-
     def test_threads(self):
         """ How well does this implementation work with threads?"""