From 93949e7cb4a3cc562d452d379acb86b253454cf7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 6 Oct 2018 22:24:52 -0500 Subject: [PATCH] Blacking of project --- cached_property.py | 1 - conftest.py | 4 ++-- setup.py | 2 +- tests/test_async_cached_property.py | 9 ++++----- tests/test_cached_property.py | 3 --- tests/test_coroutine_cached_property.py | 4 ---- 6 files changed, 7 insertions(+), 16 deletions(-) diff --git a/cached_property.py b/cached_property.py index 125f619..67fa01a 100644 --- a/cached_property.py +++ b/cached_property.py @@ -36,7 +36,6 @@ class cached_property(object): return value def _wrap_in_coroutine(self, obj): - @asyncio.coroutine def wrapper(): future = asyncio.ensure_future(self.func(obj)) diff --git a/conftest.py b/conftest.py index 37daf27..0563f64 100644 --- a/conftest.py +++ b/conftest.py @@ -2,10 +2,10 @@ import sys # Whether "import asyncio" works -has_asyncio = (sys.version_info[0] == 3 and sys.version_info[1] >= 4) +has_asyncio = sys.version_info[0] == 3 and sys.version_info[1] >= 4 # Whether the async and await keywords work -has_async_await = (sys.version_info[0] == 3 and sys.version_info[1] >= 5) +has_async_await = sys.version_info[0] == 3 and sys.version_info[1] >= 5 print("conftest.py", has_asyncio, has_async_await) diff --git a/setup.py b/setup.py index 3506fe1..af68a07 100755 --- a/setup.py +++ b/setup.py @@ -53,6 +53,6 @@ setup( "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7" + "Programming Language :: Python :: 3.7", ], ) diff --git a/tests/test_async_cached_property.py b/tests/test_async_cached_property.py index dd9e7bd..f4f93c7 100644 --- a/tests/test_async_cached_property.py +++ b/tests/test_async_cached_property.py @@ -6,8 +6,8 @@ from threading import Lock, Thread from freezegun import freeze_time import cached_property -def unittest_run_loop(f): +def unittest_run_loop(f): def wrapper(*args, **kwargs): coro = asyncio.coroutine(f) future = coro(*args, **kwargs) @@ -16,6 +16,7 @@ def unittest_run_loop(f): return wrapper + def CheckFactory(cached_property_decorator, threadsafe=False): """ Create dynamically a Check class whose add_cached method is decorated by @@ -23,7 +24,6 @@ def CheckFactory(cached_property_decorator, threadsafe=False): """ class Check(object): - def __init__(self): self.control_total = 0 self.cached_total = 0 @@ -62,6 +62,7 @@ def CheckFactory(cached_property_decorator, threadsafe=False): return Check + class TestCachedProperty(unittest.TestCase): """Tests for cached_property""" @@ -121,9 +122,7 @@ class TestCachedProperty(unittest.TestCase): @unittest_run_loop async def test_none_cached_property(self): - class Check(object): - def __init__(self): self.cached_total = None @@ -131,4 +130,4 @@ class TestCachedProperty(unittest.TestCase): async def add_cached(self): return self.cached_total - await self.assert_cached(Check(), None) \ No newline at end of file + await self.assert_cached(Check(), None) diff --git a/tests/test_cached_property.py b/tests/test_cached_property.py index 5d8ea92..5082416 100644 --- a/tests/test_cached_property.py +++ b/tests/test_cached_property.py @@ -15,7 +15,6 @@ def CheckFactory(cached_property_decorator, threadsafe=False): """ class Check(object): - def __init__(self): self.control_total = 0 self.cached_total = 0 @@ -105,9 +104,7 @@ class TestCachedProperty(unittest.TestCase): self.assert_cached(check, 2) def test_none_cached_property(self): - class Check(object): - def __init__(self): self.cached_total = None diff --git a/tests/test_coroutine_cached_property.py b/tests/test_coroutine_cached_property.py index 30723cf..88790a0 100644 --- a/tests/test_coroutine_cached_property.py +++ b/tests/test_coroutine_cached_property.py @@ -13,7 +13,6 @@ import cached_property def unittest_run_loop(f): - def wrapper(*args, **kwargs): coro = asyncio.coroutine(f) future = coro(*args, **kwargs) @@ -30,7 +29,6 @@ def CheckFactory(cached_property_decorator): """ class Check(object): - def __init__(self): self.control_total = 0 self.cached_total = 0 @@ -115,9 +113,7 @@ class TestCachedProperty(unittest.TestCase): @unittest_run_loop @asyncio.coroutine def test_none_cached_property(self): - class Check(object): - def __init__(self): self.cached_total = None -- 2.30.2