mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 15:40:26 +01:00
update launch
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
b37c178f1c
commit
0a7f111236
2 changed files with 13 additions and 5 deletions
7
.vscode/launch.json
vendored
7
.vscode/launch.json
vendored
|
|
@ -7,7 +7,7 @@
|
|||
"request": "launch",
|
||||
"program": "tools/build.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false
|
||||
"justMyCode": true
|
||||
},
|
||||
{
|
||||
"name": "Python: Test OpenAPI Serialize",
|
||||
|
|
@ -16,7 +16,10 @@
|
|||
"program": "test/python/test_serialize.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false,
|
||||
"preLaunchTask": "build"
|
||||
"preLaunchTask": "build",
|
||||
"env": {
|
||||
"ERROR_UNCATCHED": "True"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ from pathlib import Path
|
|||
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s")
|
||||
logger = logging.getLogger("test_serialize")
|
||||
|
||||
ERROR_UNCATCHED = os.environ.get("ERROR_UNCATCHED", "false").lower() == "true"
|
||||
|
||||
if Path("cookie.json").exists():
|
||||
with open("cookie.json", "r") as f:
|
||||
cookies = json.load(f)
|
||||
|
|
@ -65,11 +67,14 @@ for x in [pt.DefaultApi, pt.TweetApi, pt.UserApi, pt.UserListApi]:
|
|||
try:
|
||||
res = getattr(x(api_client), props)(**kwargs)
|
||||
except Exception as e:
|
||||
logger.error(f"{key}")
|
||||
logger.error(e)
|
||||
if ERROR_UNCATCHED:
|
||||
raise e
|
||||
import traceback
|
||||
|
||||
logger.error(traceback.print_exc())
|
||||
logger.error("==========[STACK TRACE]==========")
|
||||
for trace in traceback.format_exc().split("\n"):
|
||||
logger.error(trace)
|
||||
logger.info("================================")
|
||||
error_count += 1
|
||||
|
||||
if error_count > 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue