8000 Fix doctests. · dry-python/dry-python.github.io@5bfca32 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5bfca32

Browse files
committed
Fix doctests.
1 parent a0e99e3 commit 5bfca32

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ And a framework of your choice will not even notice the change.
5959

6060
```pycon
6161

62-
>>> from .views import BuySubscriptionView
62+
>>> from app.views import BuySubscriptionView
6363

6464
>>> urlpatterns = [
6565
... path("buy_subscription/<int:id>/", BuySubscriptionView.as_view()),

mddoctest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import builtins
12
import sys
23
from doctest import testfile
34
from glob import glob
5+
from unittest import mock
6+
7+
8+
def _setup():
9+
sys.modules["app.views"] = mock.Mock()
10+
builtins.path = mock.Mock()
11+
builtins.workflows = mock.Mock()
412

513

614
def _main():
@@ -13,4 +21,5 @@ def _main():
1321

1422

1523
if __name__ == "__main__":
24+
_setup()
1625
_main()

0 commit comments

Comments
 (0)
0