mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-30 19:28:12 +08:00
Add a root test target that calls sub-tests
This commit is contained in:
@@ -10,3 +10,7 @@ lint:
|
||||
clean:
|
||||
rm -f app/web/templates/index.html
|
||||
rm -rf app/web/static
|
||||
|
||||
.PHONY: unit-test
|
||||
unit-test:
|
||||
pytest -s test
|
||||
|
||||
@@ -19,7 +19,7 @@ class EndPoints(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.ps = Popen(["cellxgene", "launch", "example-dataset/pbmc3k.h5ad", "--verbose", "--port", "5005"])
|
||||
cls.ps = Popen(["cellxgene", "launch", "../example-dataset/pbmc3k.h5ad", "--verbose", "--port", "5005"])
|
||||
session = requests.Session()
|
||||
for i in range(90):
|
||||
try:
|
||||
|
||||
@@ -21,7 +21,7 @@ class WithNaNs(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.ps = Popen(
|
||||
["cellxgene", "launch", "server/test/test_datasets/nan.h5ad", "--verbose", "--port", "5006"]
|
||||
["cellxgene", "launch", "test/test_datasets/nan.h5ad", "--verbose", "--port", "5006"]
|
||||
)
|
||||
session = requests.Session()
|
||||
for i in range(90):
|
||||
|
||||
@@ -21,12 +21,12 @@ class NaNTest(unittest.TestCase):
|
||||
}
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", category=UserWarning)
|
||||
self.data = ScanpyEngine(DataLocator("server/test/test_datasets/nan.h5ad"), self.args)
|
||||
self.data = ScanpyEngine(DataLocator("test/test_datasets/nan.h5ad"), self.args)
|
||||
self.data._create_schema()
|
||||
|
||||
def test_load(self):
|
||||
with self.assertWarns(UserWarning):
|
||||
ScanpyEngine(DataLocator("server/test/test_datasets/nan.h5ad"), self.args)
|
||||
ScanpyEngine(DataLocator("test/test_datasets/nan.h5ad"), self.args)
|
||||
|
||||
def test_init(self):
|
||||
self.assertEqual(self.data.cell_count, 100)
|
||||
|
||||
@@ -19,13 +19,13 @@ Test the scanpy engine using the pbmc3k data set.
|
||||
|
||||
|
||||
@parameterized_class(("data_locator", "backed"), [
|
||||
("example-dataset/pbmc3k.h5ad", False),
|
||||
("server/test/test_datasets/pbmc3k-CSC-gz.h5ad", False),
|
||||
("server/test/test_datasets/pbmc3k-CSR-gz.h5ad", False),
|
||||
("../example-dataset/pbmc3k.h5ad", False),
|
||||
("test/test_datasets/pbmc3k-CSC-gz.h5ad", False),
|
||||
("test/test_datasets/pbmc3k-CSR-gz.h5ad", False),
|
||||
|
||||
("example-dataset/pbmc3k.h5ad", True),
|
||||
("server/test/test_datasets/pbmc3k-CSC-gz.h5ad", True),
|
||||
("server/test/test_datasets/pbmc3k-CSR-gz.h5ad", True),
|
||||
("../example-dataset/pbmc3k.h5ad", True),
|
||||
("test/test_datasets/pbmc3k-CSC-gz.h5ad", True),
|
||||
("test/test_datasets/pbmc3k-CSR-gz.h5ad", True),
|
||||
])
|
||||
class EngineTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
||||
@@ -11,7 +11,7 @@ class DataLoadEngineTest(unittest.TestCase):
|
||||
Test file loading, including deferred loading/update.
|
||||
"""
|
||||
def setUp(self):
|
||||
self.data_file = DataLocator("example-dataset/pbmc3k.h5ad")
|
||||
self.data_file = DataLocator("../example-dataset/pbmc3k.h5ad")
|
||||
self.data = ScanpyEngine()
|
||||
|
||||
def test_init(self):
|
||||
@@ -76,7 +76,7 @@ class DataLocatorEngineTest(unittest.TestCase):
|
||||
self.assertEqual(data.gene_count, 1838)
|
||||
|
||||
def test_posix_file(self):
|
||||
locator = DataLocator("example-dataset/pbmc3k.h5ad")
|
||||
locator = DataLocator("../example-dataset/pbmc3k.h5ad")
|
||||
data = ScanpyEngine(locator, self.args)
|
||||
self.stdAsserts(data)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class WritableAnnotationTest(unittest.TestCase):
|
||||
"annotations_file": self.annotations_file,
|
||||
"annotations_output_dir": None
|
||||
}
|
||||
self.data = ScanpyEngine(DataLocator("example-dataset/pbmc3k.h5ad"), args)
|
||||
self.data = ScanpyEngine(DataLocator("../example-dataset/pbmc3k.h5ad"), args)
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self.tmpDir)
|
||||
|
||||
Reference in New Issue
Block a user