襄阳市建设局网站,网站html源码,在ps中网站界面应做多大,微信代运营第一步#xff1a;安装 和查看版本 pycharm settings 查看 第二步#xff1a; 编写test_example.py
def inc(x):return x1
def test_answer():assert inc(4) 5
第三步#xff1a;在当前路径下执行pytest 命令
PS E:\data\web测试\Selenium3自动化测试实战——基于Pyth…第一步安装 和查看版本 pycharm settings 查看 第二步 编写test_example.py
def inc(x):return x1
def test_answer():assert inc(4) 5
第三步在当前路径下执行pytest 命令
PS E:\data\web测试\Selenium3自动化测试实战——基于Python语言\mycode\pytest_example pytesttest session starts
platform win32 -- Python 3.10.9, pytest-7.1.2, pluggy-1.0.0
rootdir: E:\data\web测试\Selenium3自动化测试实战——基于Python语言\mycode\pytest_example
plugins: anyio-3.5.0
collected 1 item test_sample.py . [100%] 1 passed in 0.07s
PS E:\data\web测试\Selenium3自动化测试实战——基于Python语言\mycode\pytest_example pytest --version
pytest 7.1.2
PS E:\data\web测试\Selenium3自动化测试实战——基于Python语言\mycode\pytest_exampletest_sample.py 后面带了个“.” 表示通过
def inc(x):return x 1def test_answer():ret inc(3)assert ret 111如果不符合预期显示结果如下
PS E:\data\web测试\Selenium3自动化测试实战——基于Python语言\mycode\pytest_example pytesttest session starts
platform win32 -- Python 3.10.9, pytest-7.1.2, pluggy-1.0.0
rootdir: E:\data\web测试\Selenium3自动化测试实战——基于Python语言\mycode\pytest_example
plugins: anyio-3.5.0
collected 1 item test_sample.py F [100%] FAILURES
____________________________________________________________________________ test_answer ____________________________________________________________________________def test_answer():ret inc(3)assert ret 1111
E assert 4 1111test_sample.py:7: AssertionErrorshort test summary info
FAILED test_sample.py::test_answer - assert 4 11111 failed in 0.40s
PS E:\data\web测试\Selenium3自动化测试实战——基于Python语言\mycode\pytest_example