加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
requests-2.20.0-no-py2-httpbin.patch 796 Bytes
一键复制 编辑 原始数据 按行查看 历史
orange-snn 提交于 2019-12-28 09:22 . init
diff --git a/tests/conftest.py b/tests/conftest.py
index cd64a76..1d5ddbb 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -14,11 +14,23 @@ def prepare_url(value):
return inner
-@pytest.fixture
-def httpbin(httpbin):
- return prepare_url(httpbin)
+import sys
+if sys.version_info[0] < 3:
+ @pytest.fixture
+ def httpbin():
+ pytest.skip('No httpbin for Python 2')
-@pytest.fixture
-def httpbin_secure(httpbin_secure):
- return prepare_url(httpbin_secure)
+ @pytest.fixture
+ def httpbin_secure():
+ pytest.skip('No httpbin for Python 2')
+
+else:
+ @pytest.fixture
+ def httpbin(httpbin):
+ return prepare_url(httpbin)
+
+
+ @pytest.fixture
+ def httpbin_secure(httpbin_secure):
+ return prepare_url(httpbin_secure)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化