import pytest
import allure
import requests

class TestSimple(object):
    def TestWatcher(self):
        url = "http://wthrcdn.etouch.cn/weather_mini?city=成都"
       r = requests.get(url)
        assert r.status_code == 200
        d = r.json()
        print(d)

  

No tests were found

 

 

 结果问题查询:pytest 启动文件名是以test开头,函数名是以test开头。所以我们把上面的函数名改下,把TestWacher改为testWacher再去执行,效果如下:

No tests were found

 

相关文章:

  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-27
  • 2021-06-30
  • 2022-01-14
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案