File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414# third-party imports
1515import pytest
1616from birch import Birch # type: ignore[import-not-found]
17+
1718try :
1819 import pandas as pd
1920except (ImportError , ModuleNotFoundError ):
2829 print ("pymongo is not installed; tests requiring pymongo will fail!" )
2930 pymongo = None
3031 OperationFailure = None
32+
3133 # define a mock MongoClient class that will raise an exception
3234 # on init, warning that pymongo is not installed
3335 class MongoClient :
3436 def __init__ (self , * args , ** kwargs ):
3537 raise ImportError ("pymongo is not installed!" )
38+
39+
3640try :
3741 from pymongo_inmemory import MongoClient as InMemoryMongoClient
3842except (ImportError , ModuleNotFoundError ):
43+
3944 class InMemoryMongoClient :
4045 def __init__ (self , * args , ** kwargs ):
4146 raise ImportError ("pymongo_inmemory is not installed!" )
42- print ("pymongo_inmemory is not installed; "
43- "in-memory MongoDB tests will fail!" )
47+
48+ print (
49+ "pymongo_inmemory is not installed; in-memory MongoDB tests will fail!"
50+ )
4451
4552# local imports
4653from cachier import cachier
4754from cachier .config import CacheEntry
4855from cachier .cores .base import RecalculationNeeded
4956from cachier .cores .mongo import _MongoCore
5057
51-
5258# === Enables testing vs a real MongoDB instance ===
5359
5460
You can’t perform that action at this time.
0 commit comments