mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 23:50: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",
|
"request": "launch",
|
||||||
"program": "tools/build.py",
|
"program": "tools/build.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false
|
"justMyCode": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Python: Test OpenAPI Serialize",
|
"name": "Python: Test OpenAPI Serialize",
|
||||||
|
|
@ -16,7 +16,10 @@
|
||||||
"program": "test/python/test_serialize.py",
|
"program": "test/python/test_serialize.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"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")
|
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s")
|
||||||
logger = logging.getLogger("test_serialize")
|
logger = logging.getLogger("test_serialize")
|
||||||
|
|
||||||
|
ERROR_UNCATCHED = os.environ.get("ERROR_UNCATCHED", "false").lower() == "true"
|
||||||
|
|
||||||
if Path("cookie.json").exists():
|
if Path("cookie.json").exists():
|
||||||
with open("cookie.json", "r") as f:
|
with open("cookie.json", "r") as f:
|
||||||
cookies = json.load(f)
|
cookies = json.load(f)
|
||||||
|
|
@ -65,11 +67,14 @@ for x in [pt.DefaultApi, pt.TweetApi, pt.UserApi, pt.UserListApi]:
|
||||||
try:
|
try:
|
||||||
res = getattr(x(api_client), props)(**kwargs)
|
res = getattr(x(api_client), props)(**kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"{key}")
|
if ERROR_UNCATCHED:
|
||||||
logger.error(e)
|
raise e
|
||||||
import traceback
|
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
|
error_count += 1
|
||||||
|
|
||||||
if error_count > 0:
|
if error_count > 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue