mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-05 14:18:12 +08:00
fix race condition in test_oauth (#1956)
This commit is contained in:
@@ -129,9 +129,9 @@ def can_cast_to_int32(dtype, array_values=None):
|
|||||||
return True
|
return True
|
||||||
ii32 = np.iinfo(np.int32)
|
ii32 = np.iinfo(np.int32)
|
||||||
if (
|
if (
|
||||||
not ordered_array_values.empty
|
not ordered_array_values.empty
|
||||||
and (ordered_array_values.min() >= ii32.min and ordered_array_values.max() <= ii32.max)
|
and (ordered_array_values.min() >= ii32.min and ordered_array_values.max() <= ii32.max)
|
||||||
or ordered_array_values.empty
|
or ordered_array_values.empty
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -73,13 +73,15 @@ def launch_mock_oauth():
|
|||||||
|
|
||||||
|
|
||||||
class AuthTest(unittest.TestCase):
|
class AuthTest(unittest.TestCase):
|
||||||
def setUp(self):
|
@classmethod
|
||||||
self.dataset_dataroot = FIXTURES_ROOT
|
def setUpClass(cls):
|
||||||
self.mock_oauth_process = Process(target=launch_mock_oauth)
|
cls.dataset_dataroot = FIXTURES_ROOT
|
||||||
self.mock_oauth_process.start()
|
cls.mock_oauth_process = Process(target=launch_mock_oauth)
|
||||||
|
cls.mock_oauth_process.start()
|
||||||
|
|
||||||
def tearDown(self):
|
@classmethod
|
||||||
self.mock_oauth_process.terminate()
|
def tearDownClass(cls):
|
||||||
|
cls.mock_oauth_process.terminate()
|
||||||
|
|
||||||
def auth_flow(self, app_config, cookie_key=None):
|
def auth_flow(self, app_config, cookie_key=None):
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class CLIPLaunchTests(unittest.TestCase):
|
|||||||
def tearDownClass(cls) -> None:
|
def tearDownClass(cls) -> None:
|
||||||
shutil.rmtree(cls.tmp_dir)
|
shutil.rmtree(cls.tmp_dir)
|
||||||
|
|
||||||
|
|
||||||
def test_dump_default_config(self):
|
def test_dump_default_config(self):
|
||||||
os.system(f"cellxgene launch --dump-default-config > {self.tmp_dir}/test_config_dump.txt")
|
os.system(f"cellxgene launch --dump-default-config > {self.tmp_dir}/test_config_dump.txt")
|
||||||
with open(f"{self.tmp_dir}/expected_config_dump.txt", "w") as expected_config:
|
with open(f"{self.tmp_dir}/expected_config_dump.txt", "w") as expected_config:
|
||||||
|
|||||||
Reference in New Issue
Block a user