美文网首页
pytest 第一程序

pytest 第一程序

作者: shan317 | 来源:发表于2020-03-30 13:43 被阅读0次
  • pytest 第一个程序
import requests
import pytest


class TestV2Api(object):
    domain = "https://www.v2ex.com/"

    @pytest.mark.timeout(2)
    def test_user_reg(self):
        path = "api/nodes/show.json?name=python"
        url = TestV2Api.domain + path
        res = requests.get(url).json()
        assert res["id"] == 90
        assert res["name"] == "python"
        assert "语言编程话题" in res["header"]

教程后续更新

相关文章

网友评论

      本文标题:pytest 第一程序

      本文链接:https://www.haomeiwen.com/subject/lkqvuhtx.html