============================== test session starts =============================== platform linux2 -- Python 2.7.16, pytest-3.10.1, py-1.7.0, pluggy-0.8.0 rootdir: /home/ralf/checkout/sourceforge/roundup.hg.tip, inifile: collected 23 items test/test_config.py ..............s..sF.... [100%] ==================================== FAILURES ==================================== ____________ TrackerConfig.testInvalidIndexerLanguage_xapian_missing _____________ self = def testInvalidIndexerLanguage_xapian_missing(self): """Using default path for indexers, make import of xapian fail and prevent exception from happening even though the indexer_language would be invalid for xapian. """ print("Testing xapian not loadable") # SETUP: same as testInvalidIndexerLanguage_w_empty self.munge_configini(mods=[ ("indexer = ", ""), ("indexer_language = ", "NO_LANG") ]) import sys # Set module to Non to prevent xapian from loading sys.modules['xapian'] = None config.load(self.dirname) # need to delete both to make python2 not error finding _xapian del(sys.modules['xapian']) > if xapian._xapian in sys.modules: E NameError: global name 'xapian' is not defined test/test_config.py:452: NameError ------------------------------ Captured stdout call ------------------------------ Testing xapian not loadable ================ 1 failed, 20 passed, 2 skipped in 25.98 seconds =================