| 1234567891011121314151617181920212223242526272829303132333435363738 | import pathlibimport asyncioimport sysimport randomtests_dir = pathlib.Path(__file__).parentproject_dir = tests_dir.parentsys.path.append(str(project_dir))import sourceclass logger(source.handler):    async def write(self, content: str) -> None:        await self._to_file(content)        await self._to_stdout(content)        await self._to_stderr(content)log = tests_dir / pathlib.Path("x.log")if log.is_file():    log.unlink()loging = logger(log)async def main():    await loging.write("That is so simple: " + str(random.randrange(1, 20)))async def core():    alls = list()    for count in range(2000):        alls.append(main())    await asyncio.gather(*alls)if __name__ == "__main__":    asyncio.run(core())
 |