当前位置: 首页 > news >正文

北京软件外包公司排行榜网页优化方案

北京软件外包公司排行榜,网页优化方案,wordpress主题模块添加图片,湖北正规网站建设质量保障前言 可怜的宾馆#xff0c;可怜得像被12月的冷雨淋湿的一条三只腿的黑狗。——《舞舞舞》 \;\\\;\\\; 目录 前言test_1或s_test格式非测试文件pytest.fixture()装饰器pytestselenium test_1或s_test格式 要么 test_前缀 在前#xff0c;要么 _test后缀 在后#xff01; …前言 可怜的宾馆可怜得像被12月的冷雨淋湿的一条三只腿的黑狗。——《舞舞舞》 \;\\\;\\\; 目录 前言test_1或s_test格式非测试文件pytest.fixture()装饰器pytestselenium test_1或s_test格式 要么 test_前缀 在前要么 _test后缀 在后 #test_1.py def test_1():nameaaassert bbnamedef test_2():nameaassert bcbnamedef test_3():a 1assert a 2def test_4():a 4assert a 2assert a in abcassert a not in abcassert a is not Trueassert a is False右击可以单独运行某个函数看看哪个错了 class TestTint:def test_5(self):a 1assert a 2def test_6(self):a 1assert a 2def test_7(self):a 1assert a 2\;\\\;\\\; 非测试文件 如果是按pytest格式的文件名但是内容不是测试的话那么会出现没有发现测试 #test_calc.py a 1 b 2 print(a b)\;\\\;\\\; pytest.fixture()装饰器 import pytestpytest.fixture(scopefunction) def fixture1():print(前置步骤1)return 4pytest.fixture(scopefunction) def fixture2():print(前置步骤2)return 2pytest.fixture(scopefunction,autouseTrue) def fixture3():print(前置步骤3)return 2def test_1(fixture1,fixture2):assert fixture1 2assert fixture2 2def test_2(fixture3):assert fixture3 2if __name__ __main__:pytest.main()可以在测试函数的位置右击运行test_1或test_2函数 \;\\\;\\\; pytestselenium 关于selenium使用的edge驱动器版本要和电脑上装的edge版本一致 pytest类要以Test为前缀 #test_f.py from selenium import webdriver from selenium.webdriver.common.by import By from time import sleep import pytest# 前置方法 pytest.fixture(scopeclass) def driver():driver webdriver.Edge(executable_pathrC:\Users\Administrator\AppData\Local\Programs\Python\Python311\Scripts\msedgedriver.exe)#C:\ProgramData\anaconda3\Scripts\msedgedriver.exereturn driverclass TestSpider:# fixture函数作为形参def test_baidu(self, driver):driver.get(https://www.baidu.com/)title driver.titleurl driver.current_urltext driver.find_element(By.CSS_SELECTOR, a[href*news.baidu.com]).textbutton driver.find_element(By.ID, su).get_attribute(value)# 检测assert title 百度一下你就知道assert url https://www.baidu.com/assert text 新闻assert button 百度一下# sleep(3) # driver.close()if __name__ __main__:pytest.main()运行命令 pytest test_f.py
http://www.hkea.cn/news/14336259/

相关文章:

  • 有哪些做问卷调查赚钱的网站photoshop下载免费版
  • 随州公司做网站国产 做 视频网站
  • 企业建站的作用是什么开一个淘宝店铺流程
  • 学校网站免费建设营销型网站是什么意思
  • 网站密码如何找回深夜的fm免费看
  • ks2e做网站如何制作家具网站
  • 哪里有做美食的视频网站石家庄+外贸网站建设公司
  • 成都网站定制开发服务器能放多少个网站
  • 深圳网站建设送域名最好的营销型网站建设公司
  • 开发一个游戏需要多少钱网站搬家seo
  • 自己怎么做电影网站吗明星网站设计
  • 井陉网站建设申请备案 关网站
  • 京东的网站规划与建设市场分析wordpress输入密码无法登陆
  • 角门网站建设网页制作与网站建设初学者必看教程
  • 个人网站建设知乎亚当学院网站视频建设教程
  • 网站建设培训教程仿微博网站模板
  • 微网站制作需要多少钱网站的后台
  • 做贵网站多少钱中山网站建设找阿江
  • 与企业网站做接口做自适应网站注意事项
  • 网站建设与运营 好考吗做wd网站实训报告总结
  • 小说网站设计模板榆林网站开发
  • 建设网站的那个公司好营销中国
  • 网站怎么排名wordpress f5
  • PHP网站开发成功案例网站建设不备案后果
  • 视频 怎么做网站新闻报道最新消息今天
  • 唐山网站建设互众动力湖南长沙怎么注册工作室
  • 美食论坛网站模板最常用的几个关键词
  • 电商网站开发教材怎么用电脑做网站
  • 出口家具东莞网站建设wordpress同时登录
  • 岳阳做网站多少钱WordPress多页面菜单