From: George Sakkis Date: Sun, 19 Apr 2015 17:59:04 +0000 (+0300) Subject: Tweak unit tests X-Git-Tag: 1.2.0~5^2~9 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7069f84248a1bcb166de44d5930b5ad3055e5751;p=cached-property.git Tweak unit tests - Fix shadowed Testcase class name in test_cached_property_ttl - Single Testcase class per cached_property variant. - Make test modules non-executable. --- diff --git a/tests/__init__.py b/tests/__init__.py old mode 100755 new mode 100644 diff --git a/tests/test_cached_property.py b/tests/test_cached_property.py old mode 100755 new mode 100644 index d39778a..bb40401 --- a/tests/test_cached_property.py +++ b/tests/test_cached_property.py @@ -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! diff --git a/tests/test_cached_property_ttl.py b/tests/test_cached_property_ttl.py index 78e2e27..2470d60 100644 --- a/tests/test_cached_property_ttl.py +++ b/tests/test_cached_property_ttl.py @@ -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) diff --git a/tests/test_threaded_cached_property.py b/tests/test_threaded_cached_property.py old mode 100755 new mode 100644 index 0d87673..aa4898c --- a/tests/test_threaded_cached_property.py +++ b/tests/test_threaded_cached_property.py @@ -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?"""