dry-python / dry-python/returns

Move several examples from the docs to tests and then `literalinclude` them

未关闭
#678 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
documentation enhancement good first issue hacktoberfest help wanted
主要语言
Python
星标
4.4k
派生
155
平均合并
2 小时 27 分钟
30 天内合并 PR
22

描述

We have several quite large examples that live in our docs:
1. https://github.com/dry-python/returns/blob/master/docs/pages/future.rst#futureresult
2. `Number` example from: https://github.com/dry-python/returns/blob/master/docs/pages/contrib/hypothesis_plugins.rst#check_all_laws
3. https://github.com/dry-python/returns/blob/master/docs/pages/context.rst#requirescontextfutureresult-container

What needs to be done?
- We need to extract these examples from docs to `tests/test_docs` folder
- Instead, we should add this:

```rst
.. literalinclude:: ../../tests/test_docs/test_${SOME_NEW_FILENAME}.py
:linenos:
```

- Provide a link to the source code on github somewhere near the example itself
- Possibly we would need to add some dev-dependencies to both `pyproject.toml` and `docs/requirements.txt`
- Make sure that it is checked by `flake8`, `mypy`, and `pytest`. And that it actually works.

This way we would have nice, complex, but working examples! 📖

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。