From 1ee9231fd5ac3df790ca89a321c8cd8e70566c2d Mon Sep 17 00:00:00 2001 From: Matt Wilber Date: Thu, 18 Oct 2018 00:34:42 +0000 Subject: [PATCH] Support Python 2 syntax in test --- tests/test_cacheutils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_cacheutils.py b/tests/test_cacheutils.py index 44a0255..1886ef8 100644 --- a/tests/test_cacheutils.py +++ b/tests/test_cacheutils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- - +import abc import string -from abc import abstractmethod, ABC +from abc import abstractmethod, ABCMeta import pytest @@ -267,7 +267,10 @@ def test_cachedmethod(): def test_cachedmethod_maintains_func_abstraction(): + ABC = abc.ABCMeta('ABC', (object,), {}) + class Car(ABC): + def __init__(self, cache=None): self.h_cache = LRI() if cache is None else cache self.hand_count = 0 @@ -314,7 +317,10 @@ def test_cachedproperty(): def test_cachedproperty_maintains_func_abstraction(): + ABC = abc.ABCMeta('ABC', (object,), {}) + class AbstractExpensiveCalculator(ABC): + @cachedproperty @abstractmethod def calculate(self):