25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

27 satır
587 B

2 yıl önce
  1. import requests
  2. import threading
  3. from urllib.parse import urljoin
  4. from be import serve
  5. from fe import conf
  6. thread: threading.Thread = None
  7. # 修改这里启动后端程序,如果不需要可删除这行代码
  8. def run_backend():
  9. # rewrite this if rewrite backend
  10. serve.be_run()
  11. def pytest_configure(config):
  12. global thread
  13. print("frontend begin test")
  14. thread = threading.Thread(target=run_backend)
  15. thread.start()
  16. def pytest_unconfigure(config):
  17. url = urljoin(conf.URL, "shutdown")
  18. requests.get(url)
  19. thread.join()
  20. print("frontend end test")