From a380ee8bd91bcf4747b87e12cbf7d301fc4c1cb7 Mon Sep 17 00:00:00 2001 From: mart-r Date: Wed, 20 Aug 2025 14:51:38 +0100 Subject: [PATCH 01/15] Explicitly specify an empty HF cache during testing of offline load --- .../components/addons/meta_cat/test_bert_meta_cat.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 0e82610a..6fca5e76 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -38,9 +38,17 @@ def guard(*args, **kwargs): # in such a situation @contextmanager def force_hf_download(): + with tempfile.TemporaryDirectory() as temp_dir: + with _force_hf_download(temp_dir): + yield + + +@contextmanager +def _force_hf_download(temp_dir_path: str): orig_from_pretrained = transformers.BertModel.from_pretrained transformers.BertModel.from_pretrained = partial( - orig_from_pretrained, force_download=True) + orig_from_pretrained, force_download=True, + cache_dir=temp_dir_path) try: yield finally: From de7d8fb262c7d8b99dbc8bd0bea71a0cf2723942 Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 10:52:14 +0100 Subject: [PATCH 02/15] Delay the exiting from context managers to allow for async network calls to happen --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 6fca5e76..ec6e971d 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -1,5 +1,6 @@ import socket from contextlib import contextmanager +import time from medcat.components.addons.meta_cat import meta_cat from medcat.storage.serialisers import serialise, deserialise @@ -83,4 +84,8 @@ def test_no_network_load(self): with assert_tries_network(): with force_hf_download(): mc = deserialise(self.mc_save_path) + # NOTE: the network calls are done async + # and as such we may need to wait for them + # to be done before we exit the context managers, + time.sleep(1.0) self.assertIsInstance(mc, meta_cat.MetaCATAddon) From 677cfd4ddb7c16b27f4f0ecd759b6ace20ddfcd6 Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 11:29:12 +0100 Subject: [PATCH 03/15] [DEBUG] Add debug output to check stuff happening in workflow --- .../addons/meta_cat/test_bert_meta_cat.py | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index ec6e971d..0dfe508f 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -1,6 +1,8 @@ import socket from contextlib import contextmanager import time +import threading +import traceback from medcat.components.addons.meta_cat import meta_cat from medcat.storage.serialisers import serialise, deserialise @@ -81,11 +83,33 @@ def tearDownClass(cls): cls.temp_dir.cleanup() def test_no_network_load(self): + import threading + import sys + import os + + print("=== DEBUG: Environment ===") + print(f"CI: {os.getenv('CI')}") + print(f"GITHUB_ACTIONS: {os.getenv('GITHUB_ACTIONS')}") + print(f"Python version: {sys.version}") + print(f"Transformers version: {transformers.__version__}") + print(f"Initial thread count: {threading.active_count()}") + print(f"Initial threads: {[t.name for t in threading.enumerate()]}") + with assert_tries_network(): with force_hf_download(): + print("=== DEBUG: Before deserialise ===") + print(f"Thread count: {threading.active_count()}") mc = deserialise(self.mc_save_path) # NOTE: the network calls are done async # and as such we may need to wait for them # to be done before we exit the context managers, - time.sleep(1.0) + print(f"=== DEBUG: After deserialise ===") + print(f"Thread count: {threading.active_count()}") + print(f"Current threads: {[t.name for t in threading.enumerate()]}") + wait_time = 5.0 if os.getenv('CI') else 1.0 + print(f"=== DEBUG: Waiting {wait_time}s for background threads ===") + time.sleep(wait_time) + print("=== DEBUG: After wait ===") + print(f"Thread count: {threading.active_count()}") + self.assertIsInstance(mc, meta_cat.MetaCATAddon) From 00c289da3447e9334bdea60135a819ccbd281027 Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 11:58:09 +0100 Subject: [PATCH 04/15] Add explicit assertion for BertModel.from_pretrained call --- .../addons/meta_cat/test_bert_meta_cat.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 0dfe508f..f7576ba9 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -49,13 +49,20 @@ def force_hf_download(): @contextmanager def _force_hf_download(temp_dir_path: str): orig_from_pretrained = transformers.BertModel.from_pretrained - transformers.BertModel.from_pretrained = partial( - orig_from_pretrained, force_download=True, - cache_dir=temp_dir_path) + + method_calls = [] + + def replacement_method(*args, **kwargs): + method_calls.append((len(args), len(kwargs))) + return orig_from_pretrained( + *args, force_download=True, + cache_dir=temp_dir_path, **kwargs) + transformers.BertModel.from_pretrained = replacement_method try: yield finally: transformers.BertModel.from_pretrained = orig_from_pretrained + assert method_calls, "BertModel.from_pretrained should be called" class BERTMetaCATTests(unittest.TestCase): From c8f36d121c44f24e08e0a255ff3c5e5e97222d6c Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 12:16:19 +0100 Subject: [PATCH 05/15] [DEBUG] Add mode debug output to check stuff happening in workflow --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index f7576ba9..962dc180 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -21,8 +21,10 @@ def assert_tries_network(): real_socket = socket.socket calls = [] + print(f"=== DEBUG: Network call interception started on thread {threading.get_ident()} ===") def guard(*args, **kwargs): + print(f"=== DEBUG: Network call intercepted on thread {threading.get_ident()} ===") calls.append((len(args), len(kwargs))) raise OSError("Network disabled for test") @@ -62,6 +64,7 @@ def replacement_method(*args, **kwargs): yield finally: transformers.BertModel.from_pretrained = orig_from_pretrained + print(f"=== DEBUG: from_pretrained called {len(method_calls)} times ===") assert method_calls, "BertModel.from_pretrained should be called" From 99b88b13d3ca974b07f5d27389d6551bedc71710 Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 13:20:57 +0100 Subject: [PATCH 06/15] [DEBUG] Add mode debug output to check stuff happening in workflow (again) --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 962dc180..dcf2a1b7 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -56,9 +56,12 @@ def _force_hf_download(temp_dir_path: str): def replacement_method(*args, **kwargs): method_calls.append((len(args), len(kwargs))) - return orig_from_pretrained( + print(f"=== DEBUG: Cache dir contents BEFORE: {os.listdir(temp_dir_path)} ===") + result = orig_from_pretrained( *args, force_download=True, cache_dir=temp_dir_path, **kwargs) + print(f"=== DEBUG: Cache dir contents AFTER: {os.listdir(temp_dir_path)} ===") + return result transformers.BertModel.from_pretrained = replacement_method try: yield From 15011ff760133790c408e9560ac0a4207685635b Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 13:31:45 +0100 Subject: [PATCH 07/15] [DEBUG] Add usage of MetaCAT object after load to make sure it works --- .../addons/meta_cat/test_bert_meta_cat.py | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index dcf2a1b7..ec9b5c66 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -2,7 +2,6 @@ from contextlib import contextmanager import time import threading -import traceback from medcat.components.addons.meta_cat import meta_cat from medcat.storage.serialisers import serialise, deserialise @@ -10,7 +9,6 @@ import unittest import tempfile import os -from functools import partial import transformers @@ -108,6 +106,14 @@ def test_no_network_load(self): print(f"Initial thread count: {threading.active_count()}") print(f"Initial threads: {[t.name for t in threading.enumerate()]}") + from medcat.tokenizing.spacy_impl.tokenizers import SpacyTokenizer + from medcat.config import Config + cnf = Config() + nlp = cnf.general.nlp + tokenizer = SpacyTokenizer("en_core_web_md", + nlp.disabled_components, + False, + 1_000_000) with assert_tries_network(): with force_hf_download(): print("=== DEBUG: Before deserialise ===") @@ -116,7 +122,7 @@ def test_no_network_load(self): # NOTE: the network calls are done async # and as such we may need to wait for them # to be done before we exit the context managers, - print(f"=== DEBUG: After deserialise ===") + print("=== DEBUG: After deserialise ===") print(f"Thread count: {threading.active_count()}") print(f"Current threads: {[t.name for t in threading.enumerate()]}") wait_time = 5.0 if os.getenv('CI') else 1.0 @@ -125,4 +131,17 @@ def test_no_network_load(self): print("=== DEBUG: After wait ===") print(f"Thread count: {threading.active_count()}") - self.assertIsInstance(mc, meta_cat.MetaCATAddon) + self.assertIsInstance(mc, meta_cat.MetaCATAddon) + mc: meta_cat.MetaCATAddon + doc = tokenizer("Some Text With Something") + ent = doc[2:4] + ent.detected_name = 'something' + ent.link_candidates = ['s', 'ome', 'thing'] + ent.confidence = ent.context_similarity = 0.95 + ent.cui = 'C123' + ent.id = 0 + doc.ner_ents = [ent] + doc.linked_ents = [ent] + mc(doc) + print("=== DEBUG: After usage ===") + print(f"Thread count: {threading.active_count()}") From 529cc100a78b4a9116e52a8ace45c01250df6e13 Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 13:52:05 +0100 Subject: [PATCH 08/15] Add assertion for Meta Annotation data --- medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py | 1 + 1 file changed, 1 insertion(+) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index ec9b5c66..2d93a102 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -143,5 +143,6 @@ def test_no_network_load(self): doc.ner_ents = [ent] doc.linked_ents = [ent] mc(doc) + self.assertTrue(ent.has_addon_data(meta_cat._META_ANNS_PATH)) print("=== DEBUG: After usage ===") print(f"Thread count: {threading.active_count()}") From 387a735645d7e2975f27197caeb91ec70d2a2973 Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 14:04:11 +0100 Subject: [PATCH 09/15] [DEBUG] Add more debug output regarding from_pretrained and network call checks around the assertions --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 2d93a102..6f17c7d5 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -31,6 +31,7 @@ def guard(*args, **kwargs): yield finally: socket.socket = real_socket + print(f"=== DEBUG: Found", len(calls), "network calls") assert calls, "No network calls were made during the test" @@ -66,6 +67,7 @@ def replacement_method(*args, **kwargs): finally: transformers.BertModel.from_pretrained = orig_from_pretrained print(f"=== DEBUG: from_pretrained called {len(method_calls)} times ===") + print(f"=== DEBUG: Found", len(method_calls), "BertModel.from_pretrained calls") assert method_calls, "BertModel.from_pretrained should be called" From 1f06a6247c450e7a58296a64a9a1eaa2d502fd9a Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 15:07:06 +0100 Subject: [PATCH 10/15] Update model variant before saving so as to force network call --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 6f17c7d5..ea88fa3e 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -88,6 +88,8 @@ def setUpClass(cls): cls.meta_cat = meta_cat.MetaCATAddon.create_new(cls.cnf, cls.tokenizer) cls.temp_dir = tempfile.TemporaryDirectory() + # change model variant to force a network call upon load + cls.cnf.model.model_variant = 'prajjwal1/bert-small' cls.mc_save_path = os.path.join(cls.temp_dir.name, "bert_meta_cat") serialise('dill', cls.meta_cat, cls.mc_save_path) From cebd9b2f6d3c838be9cf007cb03e8de64cb91295 Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 15:24:16 +0100 Subject: [PATCH 11/15] Revert "[DEBUG] Add more debug output regarding from_pretrained and network call checks around the assertions" This reverts commit 387a735645d7e2975f27197caeb91ec70d2a2973. --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index ea88fa3e..5333ecba 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -31,7 +31,6 @@ def guard(*args, **kwargs): yield finally: socket.socket = real_socket - print(f"=== DEBUG: Found", len(calls), "network calls") assert calls, "No network calls were made during the test" @@ -67,7 +66,6 @@ def replacement_method(*args, **kwargs): finally: transformers.BertModel.from_pretrained = orig_from_pretrained print(f"=== DEBUG: from_pretrained called {len(method_calls)} times ===") - print(f"=== DEBUG: Found", len(method_calls), "BertModel.from_pretrained calls") assert method_calls, "BertModel.from_pretrained should be called" From 6f0c3067d0f805a6523a0db83f71a19b4b9be7a2 Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 15:24:17 +0100 Subject: [PATCH 12/15] Revert "[DEBUG] Add mode debug output to check stuff happening in workflow (again)" This reverts commit 99b88b13d3ca974b07f5d27389d6551bedc71710. --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 5333ecba..76a81059 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -54,12 +54,9 @@ def _force_hf_download(temp_dir_path: str): def replacement_method(*args, **kwargs): method_calls.append((len(args), len(kwargs))) - print(f"=== DEBUG: Cache dir contents BEFORE: {os.listdir(temp_dir_path)} ===") - result = orig_from_pretrained( + return orig_from_pretrained( *args, force_download=True, cache_dir=temp_dir_path, **kwargs) - print(f"=== DEBUG: Cache dir contents AFTER: {os.listdir(temp_dir_path)} ===") - return result transformers.BertModel.from_pretrained = replacement_method try: yield From 54fd41bceb05be6df0854ca8b77553004d22c66f Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 15:24:18 +0100 Subject: [PATCH 13/15] Revert "[DEBUG] Add mode debug output to check stuff happening in workflow" This reverts commit c8f36d121c44f24e08e0a255ff3c5e5e97222d6c. --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 76a81059..35692b96 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -19,10 +19,8 @@ def assert_tries_network(): real_socket = socket.socket calls = [] - print(f"=== DEBUG: Network call interception started on thread {threading.get_ident()} ===") def guard(*args, **kwargs): - print(f"=== DEBUG: Network call intercepted on thread {threading.get_ident()} ===") calls.append((len(args), len(kwargs))) raise OSError("Network disabled for test") @@ -62,7 +60,6 @@ def replacement_method(*args, **kwargs): yield finally: transformers.BertModel.from_pretrained = orig_from_pretrained - print(f"=== DEBUG: from_pretrained called {len(method_calls)} times ===") assert method_calls, "BertModel.from_pretrained should be called" From 3b5f0ead4dc34823c43acb10cff57220f32828fe Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 15:25:26 +0100 Subject: [PATCH 14/15] Revert "[DEBUG] Add debug output to check stuff happening in workflow" This reverts commit 677cfd4ddb7c16b27f4f0ecd759b6ace20ddfcd6. --- .../addons/meta_cat/test_bert_meta_cat.py | 48 +------------------ 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index 35692b96..f5090533 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -1,7 +1,6 @@ import socket from contextlib import contextmanager import time -import threading from medcat.components.addons.meta_cat import meta_cat from medcat.storage.serialisers import serialise, deserialise @@ -90,55 +89,10 @@ def tearDownClass(cls): cls.temp_dir.cleanup() def test_no_network_load(self): - import threading - import sys - import os - - print("=== DEBUG: Environment ===") - print(f"CI: {os.getenv('CI')}") - print(f"GITHUB_ACTIONS: {os.getenv('GITHUB_ACTIONS')}") - print(f"Python version: {sys.version}") - print(f"Transformers version: {transformers.__version__}") - print(f"Initial thread count: {threading.active_count()}") - print(f"Initial threads: {[t.name for t in threading.enumerate()]}") - - from medcat.tokenizing.spacy_impl.tokenizers import SpacyTokenizer - from medcat.config import Config - cnf = Config() - nlp = cnf.general.nlp - tokenizer = SpacyTokenizer("en_core_web_md", - nlp.disabled_components, - False, - 1_000_000) with assert_tries_network(): with force_hf_download(): - print("=== DEBUG: Before deserialise ===") - print(f"Thread count: {threading.active_count()}") mc = deserialise(self.mc_save_path) # NOTE: the network calls are done async # and as such we may need to wait for them # to be done before we exit the context managers, - print("=== DEBUG: After deserialise ===") - print(f"Thread count: {threading.active_count()}") - print(f"Current threads: {[t.name for t in threading.enumerate()]}") - wait_time = 5.0 if os.getenv('CI') else 1.0 - print(f"=== DEBUG: Waiting {wait_time}s for background threads ===") - time.sleep(wait_time) - print("=== DEBUG: After wait ===") - print(f"Thread count: {threading.active_count()}") - - self.assertIsInstance(mc, meta_cat.MetaCATAddon) - mc: meta_cat.MetaCATAddon - doc = tokenizer("Some Text With Something") - ent = doc[2:4] - ent.detected_name = 'something' - ent.link_candidates = ['s', 'ome', 'thing'] - ent.confidence = ent.context_similarity = 0.95 - ent.cui = 'C123' - ent.id = 0 - doc.ner_ents = [ent] - doc.linked_ents = [ent] - mc(doc) - self.assertTrue(ent.has_addon_data(meta_cat._META_ANNS_PATH)) - print("=== DEBUG: After usage ===") - print(f"Thread count: {threading.active_count()}") + self.assertIsInstance(mc, meta_cat.MetaCATAddon) From 246698e8fab1bed83dadd963cd0da847e0edeadc Mon Sep 17 00:00:00 2001 From: mart-r Date: Thu, 21 Aug 2025 15:25:47 +0100 Subject: [PATCH 15/15] Revert "Delay the exiting from context managers to allow for async network calls to happen" This reverts commit de7d8fb262c7d8b99dbc8bd0bea71a0cf2723942. --- .../tests/components/addons/meta_cat/test_bert_meta_cat.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py index f5090533..cd6b811e 100644 --- a/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py +++ b/medcat-v2/tests/components/addons/meta_cat/test_bert_meta_cat.py @@ -1,6 +1,5 @@ import socket from contextlib import contextmanager -import time from medcat.components.addons.meta_cat import meta_cat from medcat.storage.serialisers import serialise, deserialise @@ -92,7 +91,4 @@ def test_no_network_load(self): with assert_tries_network(): with force_hf_download(): mc = deserialise(self.mc_save_path) - # NOTE: the network calls are done async - # and as such we may need to wait for them - # to be done before we exit the context managers, self.assertIsInstance(mc, meta_cat.MetaCATAddon)