def setUp(self): """ This is a rather complex setUp since I need to move the failing_spider.py plugin to the plugin directory in order to be able to run it afterwards. In the tearDown method, I'll remove the file. """ self.src = os.path.join(ROOT_PATH, 'plugins', 'tests', 'crawl', 'failing_spider.py') self.dst = os.path.join(ROOT_PATH, 'plugins', 'crawl', 'failing_spider.py') # This lock prevents others (which also implement the locking) from # removing our file self.lock = FileLock(self.dst, timeout=60) self.lock.acquire() shutil.copy(self.src, self.dst) super(TestConsoleBugReport, self).setUp()