Skip to content

Commit

Permalink
removed pure py tests from c extension builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Sulla committed Nov 24, 2023
1 parent 9f593af commit 7271f46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 42 deletions.
14 changes: 3 additions & 11 deletions test/test_frozendict.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from frozendict.core import frozendict as FrozendictPyClass
from .common import FrozendictCommonTest
from .frozendict_only import FrozendictOnlyTest
import frozendict as cool
Expand All @@ -7,14 +6,7 @@

is_subclass = False


class TestPyFrozendict(FrozendictCommonTest, FrozendictOnlyTest):
FrozendictClass = FrozendictPyClass
c_ext = False
class TestFrozendict(FrozendictCommonTest, FrozendictOnlyTest):
FrozendictClass = FrozendictClass
c_ext = cool.c_ext
is_subclass = is_subclass

if cool.c_ext:
class TestCFrozendict(FrozendictCommonTest, FrozendictOnlyTest):
FrozendictClass = FrozendictClass
c_ext = cool.c_ext
is_subclass = is_subclass
37 changes: 6 additions & 31 deletions test/test_frozendict_subclass.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from frozendict.core import frozendict as FrozendictPyClass
from .common import FrozendictCommonTest
from .subclass_only import FrozendictSubclassOnlyTest
import frozendict as cool
Expand All @@ -8,48 +7,24 @@
is_subclass = True


class FrozendictPySubclass(FrozendictPyClass):
class FrozendictSubclass(FrozendictClass):
def __new__(cls, *args, **kwargs):
return super().__new__(cls, *args, **kwargs)


class FrozendictPyMissingSubclass(FrozendictPyClass):
class FrozendictMissingSubclass(FrozendictClass):
def __new__(cls, *args, **kwargs):
return super().__new__(cls, *args, **kwargs)

def __missing__(self, key):
return key


class TestFrozendictPySubclass(
class TestFrozendictSubclass(
FrozendictCommonTest,
FrozendictSubclassOnlyTest
):
FrozendictClass = FrozendictPySubclass
FrozendictMissingClass = FrozendictPyMissingSubclass
c_ext = False
FrozendictClass = FrozendictSubclass
FrozendictMissingClass = FrozendictMissingSubclass
c_ext = cool.c_ext
is_subclass = is_subclass


if cool.c_ext:
class FrozendictSubclass(FrozendictClass):
def __new__(cls, *args, **kwargs):
return super().__new__(cls, *args, **kwargs)


class FrozendictMissingSubclass(FrozendictClass):
def __new__(cls, *args, **kwargs):
return super().__new__(cls, *args, **kwargs)

def __missing__(self, key):
return key


class TestFrozendictSubclass(
FrozendictCommonTest,
FrozendictSubclassOnlyTest
):
FrozendictClass = FrozendictSubclass
FrozendictMissingClass = FrozendictMissingSubclass
c_ext = cool.c_ext
is_subclass = is_subclass

0 comments on commit 7271f46

Please sign in to comment.