Browse Source

输出时间

myuan 2 years ago
parent
commit
ce17af8ed6
1 changed files with 3 additions and 2 deletions
  1. 3 2
      run_test.py

+ 3 - 2
run_test.py

@@ -8,7 +8,7 @@ import asyncio.subprocess as subprocess
 import asyncio
 from watchfiles import awatch, watch
 from termcolor import colored
-
+from datetime import datetime
 
 
 async def on_modified(event):
@@ -17,6 +17,7 @@ async def on_modified(event):
     stdout, _ = await p.communicate()
     if b'error' in stdout:
         print(stdout.decode('utf-8'))
+        print(datetime.now(), '-' * 40)
         return
 
     for sql in sqls:
@@ -35,7 +36,7 @@ async def on_modified(event):
         if return_code != 0:
             print(f'{return_code=}')
             break
-    print('-'*40)
+    print(datetime.now(), '-' * 40)
 
 async def main():
     async for changes in awatch('src'):