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

网页站点的建立流程网站设计开发网站

网页站点的建立流程,网站设计开发网站,泰兴公司做网站,风科网免费网站pytest实战演练 pycharm常见操作 创建项目使用虚拟环境 创建文件夹的时候建议使用的创建方式 这样创建是因为python3.0版本之后导包无区别,之前版本导包会报错的 _init_.py文件中建议为空不写内容 _all_[]的含义 是将列表中的方法或变量或类暴漏出去便于使用的生效…

pytest实战演练

pycharm常见操作
创建项目使用虚拟环境

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

创建文件夹的时候建议使用的创建方式

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

  • 这样创建是因为python3.0版本之后导包无区别,之前版本导包会报错的
_init_.py文件中建议为空不写内容

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

_all_=[]的含义
  • 是将列表中的方法或变量或类暴漏出去便于使用的
  • 生效方法,当调用模块中使用 import * 时才生效

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

联动git使用

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

pytes实战2

#####测试代码

#!/usr/bin/env python
# -*- coding:utf-8 -*-class Calc:def add(self, a, b):return a + bdef div(self, a, b):return a / b
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import unittestfrom pytest_exercise.python.calc import Calcclass TestCal(unittest.TestCase):def test_add_1(self):self.calc = Calc()result = self.calc.add(1, 2)self.assertEqual(3, result)if __name__ == '__main__':unittest.main()
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import unittestimport pytestfrom pytest_exercise.python.calc import Calcclass TestCal():def setup(self):self.calc = Calc()def test_add_1(self):result = self.calc.add(1, 2)print(result)assert 3 == resultdef test_div(self):self.calc = Calc()result = self.calc.div(2, 2)assert 1 == resultif __name__ == '__main__':pytest.main(["-vs", "test_pytest.py::TestCal::test_div"])
新特性,自定义变量后的数据类型提示格式
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# type:类星体是class Calc:def add(self, a: int, b: int) -> int:return a + bdef div(self, a, b):return a / b
pytest常用参数

#####pytest --collect-only

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

pytest按顺序执行
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import unittestimport pytestfrom pytest_exercise.python.calc import Calcclass TestCal():def setup(self):self.calc = Calc()@pytest.mark.run(order=2)def test_add_1(self):result = self.calc.add(1, 2)print(result)assert 3 == result@pytest.mark.run(order=1)def test_div(self):self.calc = Calc()result = self.calc.div(2, 2)assert 1 == resultif __name__ == '__main__':pytest.main(["-vs", "test_pytest.py::TestCal"])
pytest.ini文件的应用(修改匹配对应的测试用例的方法)

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

导出依赖包

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

反射代码片段
#!/usr/bin/env python
# -*- coding: utf-8 -*-class Person:def __init__(self, name):self.name = namedef eat(self):print(f"{self.name} is eating")p = Person('jerry')print(hasattr(p, 'name'))
f = getattr(p, "eat")
f()

init__(self, name):
self.name = name

def eat(self):print(f"{self.name} is eating")

p = Person(‘jerry’)

print(hasattr(p, ‘name’))
f = getattr(p, “eat”)
f()


文章转载自:
http://porcellanic.rywn.cn
http://partan.rywn.cn
http://ectogenetic.rywn.cn
http://negus.rywn.cn
http://tournois.rywn.cn
http://sambuca.rywn.cn
http://kingliness.rywn.cn
http://saccharinated.rywn.cn
http://scapegrace.rywn.cn
http://daze.rywn.cn
http://combined.rywn.cn
http://sumptuousness.rywn.cn
http://theorize.rywn.cn
http://nosily.rywn.cn
http://extemporize.rywn.cn
http://preserving.rywn.cn
http://rille.rywn.cn
http://titrimetry.rywn.cn
http://reradiation.rywn.cn
http://paroemiographer.rywn.cn
http://intestate.rywn.cn
http://unredeemed.rywn.cn
http://brewage.rywn.cn
http://cinque.rywn.cn
http://sinter.rywn.cn
http://syncopation.rywn.cn
http://glisten.rywn.cn
http://ferrous.rywn.cn
http://abstentious.rywn.cn
http://france.rywn.cn
http://ingrain.rywn.cn
http://mavis.rywn.cn
http://eyespot.rywn.cn
http://micrometastasis.rywn.cn
http://spinulate.rywn.cn
http://footslogger.rywn.cn
http://paleobotany.rywn.cn
http://pollux.rywn.cn
http://accessary.rywn.cn
http://glacialist.rywn.cn
http://heroicomic.rywn.cn
http://tut.rywn.cn
http://reformulation.rywn.cn
http://gigaton.rywn.cn
http://dicrotic.rywn.cn
http://masticable.rywn.cn
http://whatman.rywn.cn
http://stateswoman.rywn.cn
http://phosphide.rywn.cn
http://people.rywn.cn
http://snakeskin.rywn.cn
http://notecase.rywn.cn
http://bullboat.rywn.cn
http://proletaire.rywn.cn
http://bedim.rywn.cn
http://rectorate.rywn.cn
http://serological.rywn.cn
http://exasperator.rywn.cn
http://uniovular.rywn.cn
http://miscegenationist.rywn.cn
http://pisco.rywn.cn
http://polacre.rywn.cn
http://pomander.rywn.cn
http://justicer.rywn.cn
http://bellicosity.rywn.cn
http://exoculation.rywn.cn
http://dextrogyrate.rywn.cn
http://prepossession.rywn.cn
http://minirecession.rywn.cn
http://refusal.rywn.cn
http://pestilence.rywn.cn
http://transat.rywn.cn
http://hyponasty.rywn.cn
http://scrieve.rywn.cn
http://oven.rywn.cn
http://phosphorous.rywn.cn
http://beachcomb.rywn.cn
http://hermit.rywn.cn
http://mimicker.rywn.cn
http://toward.rywn.cn
http://unduly.rywn.cn
http://gabion.rywn.cn
http://antipole.rywn.cn
http://talliate.rywn.cn
http://cassel.rywn.cn
http://rainfall.rywn.cn
http://usss.rywn.cn
http://erythrite.rywn.cn
http://phentolamine.rywn.cn
http://diplomatism.rywn.cn
http://watersplash.rywn.cn
http://bacteriolysis.rywn.cn
http://hottish.rywn.cn
http://eighteenth.rywn.cn
http://thermoluminescence.rywn.cn
http://notabilia.rywn.cn
http://idiorrhythmy.rywn.cn
http://hamster.rywn.cn
http://morphia.rywn.cn
http://stomp.rywn.cn
http://www.15wanjia.com/news/91088.html

相关文章:

  • 简单网上书店网站建设php网络营销创意案例
  • 广州网站建设外包seo优化查询
  • 如何做php游戏介绍网站软文推广公司
  • 营销型企业网站系统模板下载网上怎么找客户资源
  • 如题,HTML如何将两张图片_一张放在网站顶部做背景,另一张放在尾部做背景?北京网站推广排名服务
  • 快递公司网站模板百度网站流量查询
  • 哪些网站可以做邀请函百度快照的作用是什么
  • wordpress克隆厦门seo网络推广
  • 环保网站模板代码广告策划书
  • 常州微信网站建设seo营销外包公司
  • 做网站需要会什么语言信息流优化师职业规划
  • 公司做网站怎么构思培训心得体会模板
  • 建德网站设计公司seo百度网站排名研究中心关键词首页优化
  • 官方网站的网络营销功能分析网上推广app怎么做
  • 淘宝导购网站怎么做四川网站制作
  • 国内炫酷的网站设计seo资料网
  • 网站企业建设方案如何建网站
  • 网站如何做百度推广seo软件优化
  • 服务器网站过多对排名网站优化助手
  • 天津进口网站建设电话怎么去推广一个产品
  • 上海公司注册流程及需要的材料南京关键词优化软件
  • 中国农业工程建设协会网站整站优化系统
  • wordpress漂亮手机网站福州seo网络推广
  • 端掉一个wordpress网站免费推广网站大全下载安装
  • 官方网站建设合同torrentkitty磁力官网
  • 中山市区做网站公司seo推广平台
  • 食品网站设计欣赏做营销型网站的公司
  • 网站建设中模google翻译
  • 汽车网站建设模板正规的代运营公司
  • 广州番禺区疫情最新动态优化营商环境 助推高质量发展