Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doctest error #33

Merged
merged 3 commits into from
Mar 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fn/underscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def call(self, name, *args, **kwargs):
)

def __getattr__(self, name):
if name == '__wrapped__': # Guard for recursive call by doctest
raise AttributeError
attr_name = _random_name()
return self.__class__(
F(operator.attrgetter(name)) << F(self),
Expand Down
5 changes: 5 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import doctest
import unittest

from tests import *

if __name__ == "__main__":

import tests.test_doctest
doctest.testmod(tests.test_doctest)

unittest.main()
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .test_banker_queue import *
from .test_composition import *
from .test_curry import *
from .test_doctest import *
from .test_finger_tree import *
from .test_iterators import *
from .test_linked import *
Expand Down
1 change: 1 addition & 0 deletions tests/test_doctest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from fn import _