-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[run] | ||
branch = True | ||
omit = | ||
mwhutils/random/_sobol.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[nosetests] | ||
with-coverage=1 | ||
cover-inclusive=1 | ||
cover-package=mwhutils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
ABC tests. | ||
""" | ||
|
||
from __future__ import division | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
|
||
from mwhutils.abc import ABCMeta, abstractmethod | ||
|
||
|
||
def test_abc(): | ||
"""Test creation of an abstract base class.""" | ||
|
||
class FooBase(object): | ||
"""Base class.""" | ||
__metaclass__ = ABCMeta | ||
|
||
@abstractmethod | ||
def method1(self): | ||
"""Test.""" | ||
pass | ||
|
||
def method2(self): | ||
"""Test.""" | ||
pass | ||
|
||
class Foo(FooBase): | ||
"""Child class.""" | ||
def method1(self): | ||
pass | ||
|
||
def method2(self): | ||
pass | ||
|
||
instance = Foo() | ||
assert instance.method1.__doc__ == "Test." | ||
assert instance.method2.__doc__ is None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters