官方文档:https://docs.pytest.org 安装:pip install -u pytestpytest --version #查看版本(或者直接pip命令:pip show pytest ) 使用优点:非常容易上手,入门简单,文档丰富,文档中有很多实例可以参考能够支持简单的单元测试和 ...
分类:
其他好文 时间:
2020-07-04 15:10:39
阅读次数:
53
用到了mock【安装Moq】 参考: https://blog.csdn.net/hailang2ll/article/details/103105356?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachi ...
分类:
Web程序 时间:
2020-07-04 01:44:58
阅读次数:
176
导入SpringMVC项目所需要的maven依赖: <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <! ...
分类:
编程语言 时间:
2020-07-03 23:19:33
阅读次数:
74
导入SpringMVC项目所需要的maven依赖: <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <! ...
分类:
编程语言 时间:
2020-07-03 23:17:47
阅读次数:
79
存储越困难,提取越容易 HDFS客户端操作 开发环境准备 步骤一:编译对应HadoopJar包,配置Hadoop变量 步骤二:创建Maven工程,导入pom依赖 <dependencies> <dependency> <groupId>junit</groupId> <artifactId>juni ...
分类:
其他好文 时间:
2020-07-03 17:56:31
阅读次数:
59
引入maven <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> 单 ...
分类:
编程语言 时间:
2020-07-03 12:37:32
阅读次数:
101
一、Junit单元测试 1.1 测试分类: 黑盒测试:不需要写代码,给输入值,看程序是否能够输出期望的值。 白盒测试:需要写代码的。关注程序具体的执行流程。 1.2 Junit使用(白盒测试) 使用步骤: 定义一个测试类(测试用例) 测试类名:被测试的类名Test,如 CalculatorTest ...
分类:
其他好文 时间:
2020-07-03 00:41:13
阅读次数:
56
最近再做spring junit 做单元测试中,报 Failed to load ApplicationContext 错误。 import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.bea ...
分类:
移动开发 时间:
2020-06-30 12:38:56
阅读次数:
60
public class Global { public static final String YES = "1"; private static final String NO="0"; public static Object getConst(String field){ try { ret ...
分类:
其他好文 时间:
2020-06-29 15:03:40
阅读次数:
155
Go 语言推荐测试文件和源代码文件放在一块,测试文件以 _test.go 结尾。比如,当前 package 有 calc.go 一个文件,我们想测试 calc.go 中的 Add 和 Mul 函数,那么应该新建 calc_test.go 作为测试文件。 example/ |--calc.go |-- ...
分类:
其他好文 时间:
2020-06-29 00:02:11
阅读次数:
86