This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1f14f0
commit f4a0c4a
Showing
3 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import pytest | ||
from .generic_backend import GenericBackend | ||
from sage.structure.sage_object import SageObject | ||
from sage.structure.sage_object_test import SageObjectTests | ||
|
||
class GenericBackendTests: | ||
class GenericBackendTests(SageObjectTests): | ||
|
||
@pytest.fixture | ||
def backend(self) -> GenericBackend: | ||
def backend(self, *args, **kwargs) -> GenericBackend: | ||
raise NotImplementedError | ||
|
||
@pytest.fixture | ||
def sage_object(self, backend) -> SageObject: | ||
return backend | ||
|
||
def test_ncols_nonnegative(self, backend: GenericBackend): | ||
assert backend.ncols() >= 0 | ||
|
||
def test_sage_unittest_testsuite(self, backend: GenericBackend): | ||
def test_sage_unittest_testsuite(self, sage_object: SageObject): | ||
# TODO: Remove this test as soon as all old test methods are migrated | ||
from sage.misc.sage_unittest import TestSuite | ||
TestSuite(backend).run(verbose=True, raise_on_failure=True, skip="_test_pickling") | ||
TestSuite(sage_object).run(verbose=True, raise_on_failure=True, skip="_test_pickling") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
import pytest | ||
from .sage_object import SageObject | ||
|
||
class SageObjectTests: | ||
|
||
@pytest.fixture | ||
def sage_object(self, *args, **kwargs) -> SageObject: | ||
raise NotImplementedError | ||
|
||
def test_sage_unittest_testsuite(self, sage_object: SageObject): | ||
# TODO: Remove this test as soon as all old test methods are migrated | ||
from sage.misc.sage_unittest import TestSuite | ||
TestSuite(sage_object).run(verbose=True, raise_on_failure=True) |