Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
ValueError:展开时包装器循环
我的示例代码中的 Python3 测试用例 文档测试 失败 但在 Python2 中同样可以正常工作 test py class Test object def init self a 0 self a a def getattr self
python
doctest
将 Doctest 与代码一起使用时将实现放在哪里
我在用着doctest https github com onqtam doctest用于我的 C 项目中的测试 我想将测试代码与我的实现放在一起 正如库所说是可能的 但我似乎不知道如何处理 doctest 实现代码 我有一个doctest
c
CMake
doctest
以敏捷/BDD 方式在 Django 中使用 Doctests 的示例
我有兴趣学习如何以更敏捷 BDD 的方式进行文档测试和单元测试 我发现了一些看似合理的教程 但它们只是缩略图 我真正想看到的是一些采用 BDD 风格开发的 Django 项目的源代码 我不清楚的是如何处理请求对象等 我遇到过这样的情况 我已
python
django
Agile
doctest
Python 文档测试:测试 None
使用 Python 2 7 我试图测试特定函数调用的结果是否为 None 我希望这些测试能够通过 请原谅这个相当愚蠢的例子 def six or none val gt gt gt six or none 6 6 gt gt gt six
python
doctest
doctest (python) 中的模拟 Y (from X import Y)
我正在尝试创建一个带有模拟功能的文档测试 该功能位于单独的模块中 导入如下 from foomodule import foo def bar gt gt gt from minimock import mock gt gt gt mock
python
Testing
mocking
doctest
使用 doctest 并登录 python 程序
usr bin python2 4 import logging import sys import doctest def foo x gt gt gt foo 0 0 print d x logger debug d x def tes
python
logging
doctest
python 2 doctest 为何会失败,但失败消息中的值却没有差异?
我在 Windows 中使用 Python 2 7 9 我有一个 UTF 8 编码的 python 脚本文件 其中包含以下内容 coding utf 8 def test func u gt gt gt test func u return
python
Unicode
doctest
Python doctest:有条件地跳过测试
我知道如何使用跳过文档测试 doctest SKIP 但我不知道如何跳过测试有时 基于运行时条件 例如 gt gt gt if os path isfile foo open foo readlines else pass doctest
python
doctest
Python doctest:跳过整个块?
我有一个在类方法中包含文档字符串的 Python 模块 以及模块文档字符串中的一个真实示例 区别在于方法文档字符串经过精心设计 成为完全可重复的测试 而现实世界的示例只是 Linux shell 历史记录的复制粘贴 它碰巧调用了 pytho
python
doctest
在 Doctest 中使用 Mock?
我正在使用文档测试 我想知道对执行外部操作 例如发送电子邮件 连接到服务器等 的函数进行文档测试的正确方法是什么 使用 Mock 似乎是答案 但它会使函数的文档字符串变得混乱 例如 class SSHConnection BaseConne
python
Testing
mocking
python35
doctest
嵌套文档字符串的 Doctest
假设我有以下代码 def foo s A dummy function foo For example gt gt gt a This is a test string line 1 This is a test string line 2
python
doctest
docstring
python 2 / python 3 的便携式文档测试可能吗?
def fib r n memo 0 0 1 1 recursive fibonacci numbers generation with memoisation gt gt gt fib r n for n in range 10 0 1
python
doctest
Python:如何在文档测试中定义类?
我想使用 doctest 注释块来演示特定基类的用法 但这要么不能用 doctest 完成 要么我做错了什么 这是我的简单演示代码 class MyClass object gt gt gt m MyClass gt gt gt print
python
unittesting
class
doctest
使用 doctest 测试异常链接和回溯输出
如何使用 doctest 测试 多重回溯 看来要用几个ELLIPSIS and
python
doctest
配置 Django 以查找所有模块中的所有文档测试?
如果我运行以下命令 gt python manage py test Django 查看我的应用程序中的tests py 并运行该文件中的所有文档测试或单元测试 它还查看 test 字典以运行额外的测试 所以我可以从其他模块链接文档测试 如
django
doctest
djangotesting
Doctests:如何抑制/忽略输出?
以下 废话 Python 模块的 doctest 失败 gt gt gt L gt gt gt if True append to L XXX gt gt gt L 1 def append to L L append 1 class A
python
doctest
为什么 doctests 在使用 Sphinx 的 `make doctest` 运行时会引发 NameError?
我有一个简单的带有 doctest 的函数 http git io Tq2fTw 当与 Sphinx 一起运行时make doctest 给我以下错误 File scheemey rst line in default Failed exa
python
pythonsphinx
doctest
Doctest 无法识别 __future__.division
我写了以下文档测试x doctest This is something gt gt gt x 3 4 foo bar something else gt gt gt from future import division gt gt gt
python
Future
Division
doctest
包含字符串文字的文档测试
我有一个单元测试 我想为一个将 XML 作为字符串的函数编写 这是一个文档测试 我希望 XML 与测试一致 由于 XML 是多行的 我在文档测试中尝试了字符串文字 但没有成功 这是简化的测试代码 def test gt gt gt conf
python
comments
doctest
python24
使用 Pytest 运行文档测试和普通测试
在我的 Python 项目中 我使用 Pytest 目录结构为 src docs test 我有不同类型的测试 正常测试 在test 源代码中的文档测试 src 文档中的文档测试 docs rst 狮身人面像 我想一次运行所有这些 这样我就
python
Pytest
pythonsphinx
doctest
1
2
»