Fix blocking I/O in event loop in core test (#121128)
This commit is contained in:
parent
0e9acf2685
commit
8a5b201d75
1 changed files with 4 additions and 2 deletions
|
@ -9,6 +9,7 @@ import functools
|
||||||
import gc
|
import gc
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
import threading
|
import threading
|
||||||
|
@ -2009,8 +2010,9 @@ async def test_config_is_allowed_path() -> None:
|
||||||
config.allowlist_external_dirs = {os.path.realpath(tmp_dir)}
|
config.allowlist_external_dirs = {os.path.realpath(tmp_dir)}
|
||||||
|
|
||||||
test_file = os.path.join(tmp_dir, "test.jpg")
|
test_file = os.path.join(tmp_dir, "test.jpg")
|
||||||
with open(test_file, "w", encoding="utf8") as tmp_file:
|
await asyncio.get_running_loop().run_in_executor(
|
||||||
tmp_file.write("test")
|
None, Path(test_file).write_text, "test"
|
||||||
|
)
|
||||||
|
|
||||||
valid = [test_file, tmp_dir, os.path.join(tmp_dir, "notfound321")]
|
valid = [test_file, tmp_dir, os.path.join(tmp_dir, "notfound321")]
|
||||||
for path in valid:
|
for path in valid:
|
||||||
|
|
Loading…
Add table
Reference in a new issue