Skip to content

Commit

Permalink
Update test format for pytest collection
Browse files Browse the repository at this point in the history
  • Loading branch information
jschaff committed Oct 28, 2024
1 parent c94a209 commit 4970f14
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 31 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 2 additions & 31 deletions tests/test.py → tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,15 @@
import sys
import unittest

import biothings_client

sys.path.insert(0, os.path.split(os.path.split(os.path.abspath(__file__))[0])[0])

import biothings_client

sys.stdout.write(
'"biothings_client {0}" loaded from "{1}"\n'.format(biothings_client.__version__, biothings_client.__file__)
)

try:
from chem import suite as chem_suite
from gene import suite as gene_suite
from geneset import suite as geneset_suite
from variant import suite as variant_suite
except ImportError:
from tests.chem import suite as chem_suite
from tests.gene import suite as gene_suite
from tests.geneset import suite as geneset_suite
from tests.variant import suite as variant_suite


class TestBiothingsClient(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -59,22 +49,3 @@ def test_generate_settings_from_url(self):
client_settings = biothings_client.client.base.generate_settings("geneset", url="https://mygeneset.info/v1")
self.assertEqual(client_settings["class_kwargs"]["_default_url"], "https://mygeneset.info/v1")
self.assertEqual(client_settings["class_name"], "MyGenesetInfo")


def suite():
_biothings_suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestBiothingsClient)
_gene_suite = gene_suite()
_variant_suite = variant_suite()
_chem_suite = chem_suite()
_geneset_suite = geneset_suite()
_total_suite = unittest.TestSuite()
_total_suite.addTest(_biothings_suite)
_total_suite.addTest(_gene_suite)
_total_suite.addTest(_variant_suite)
_total_suite.addTest(_chem_suite)
_total_suite.addTest(_geneset_suite)
return _total_suite


if __name__ == "__main__":
unittest.TextTestRunner().run(suite())
File renamed without changes.

0 comments on commit 4970f14

Please sign in to comment.