def run(self): if not self.args.ignore_env_check: if not self.is_development: print('dropdb 只能在开发/测试环境中使用!') sys.exit(1) load_models() drop_all(self.args.db_echo)
def run(self, argv=[]): if not self.args.ignore_env_check: if not self.is_development: print('runtest should use a test settings.py!') sys.exit(1) from eva.orm import create_all, drop_all try: create_all(echo=self.args.db_echo) runner = unittest.TextTestRunner(verbosity=2) # run model TestSuite suite = load_model_tests() runner.run(suite) # run api TestSuite suite = load_api_tests() runner.run(suite) finally: drop_all(echo=self.args.db_echo)