blocktest:用于管理文档中的代码段的命令行工具

时间:2024-02-20 00:21:07
【文件属性】:

文件名称:blocktest:用于管理文档中的代码段的命令行工具

文件大小:24KB

文件格式:ZIP

更新时间:2024-02-20 00:21:07

documentation continuous-integration automated-testing ContinuousintegrationRust

*测试 blocktest是标记(例如Markdown或reStructuredText)代码块的“预处理器”。 它使您可以将代码和散文保持独立,而无需重复工作。 这个想法很简单: blocktest从更大的测试上下文中提取您的代码示例,并将它们添加到用户指定位置的标记中。 例如,假设您正在编写这一。 在此示例中,您想在说明中包含以下Python代码段: doc = nlp ( u'An example sentence. Another sentence.' ) assert ( doc [ 0 ]. text , doc [ 0 ]. head . tag_ ) == ( 'An' , 'NN' ) 使用blocktest ,您需要两个文件: 一个Python测试文件,其测试相关的样板文件中包含摘要: # test_language.py import spacy nlp = spacy . load ( 'en' ) def test_example (): doc = nlp ( u'An example sentence. Another sentenc


【文件预览】:
blocktest-master
----.travis.yml(3KB)
----tests()
--------check_examples.py(690B)
----ci()
--------before_deploy.sh(702B)
--------install.sh(1KB)
--------script.sh(501B)
--------before_deploy.ps1(580B)
----LICENSE(1KB)
----src()
--------main.rs(3KB)
--------block.rs(2KB)
--------buffer.rs(2KB)
----Cargo.toml(494B)
----examples()
--------simple()
--------jade()
----.gitignore(357B)
----README.md(2KB)

网友评论