diff --git a/paperscraper/tests/test_dump.py b/paperscraper/tests/test_dump.py index 4bc662e..f8df045 100644 --- a/paperscraper/tests/test_dump.py +++ b/paperscraper/tests/test_dump.py @@ -1,4 +1,5 @@ import logging +import importlib import os import threading @@ -7,6 +8,9 @@ from paperscraper import dump_queries from paperscraper.arxiv import get_and_dump_arxiv_papers from paperscraper.get_dumps import biorxiv, chemrxiv, medrxiv +from paperscraper.load_dumps import QUERY_FN_DICT +import paperscraper.load_dumps as load_dumps_module + logging.disable(logging.INFO) @@ -16,6 +20,12 @@ class TestDumper: + + def test_dump_existence_initial(self): + # This test checks the initial state, should be run first if order matters + assert len(QUERY_FN_DICT) == 2, "Initial length of QUERY_FN_DICT should be 2" + + @pytest.fixture def setup_medrxiv(self): return medrxiv @@ -82,6 +92,6 @@ def test_arxiv_dumping(self): assert os.path.exists("covid19_ai_imaging.jsonl") def test_dump_existence(self): + importlib.reload(load_dumps_module) from paperscraper.load_dumps import QUERY_FN_DICT - - assert len(QUERY_FN_DICT) > 2 + assert len(QUERY_FN_DICT) > 2, "Expected QUERY_FN_DICT to be updated by previous tests"