Permalink
Browse files

Docs/fixes (#102)

* Fixed parameters in assertCategoricalLevel(Not)In docstrings

Closes #99

* Document how to run tests with logger configured inside `if __name__` block

Closes #101

* Groomin'
  • Loading branch information...
thejunglejane committed Nov 11, 2018
1 parent c1e5373 commit c346e8f5859b2943e59307e69c0a444575f10c7b
Showing with 16 additions and 6 deletions.
  1. +2 −0 docs/changelog.rst
  2. +8 −0 marbles/core/marbles/core/log.py
  3. +6 −6 marbles/mixins/marbles/mixins/mixins.py
@@ -2,6 +2,8 @@
Changelog
=========

* :support: `101` Added note about how to execute logging configured tests
* :support: `99` Fixed ``assertCategoricalLevel(Not)In`` docstring parameters
* :release:`0.10.0 <2018-09-23>`
* :feature:`92` Improve indentation of multiline locals
* :support:`90` Added support for python 3.7
@@ -96,6 +96,14 @@ class AssertionLogger(object):
log.logger.configure(logfile='/path/to/marbles.log',
attrs=['filename', 'date'])
marbles.core.main()
.. note::
If you configure logging within an ``if __name__ == '__main__'``,
block (as opposed to via environment variables), you must run
your tests with ``python /path/to/tests.py``. If you run your
tests with ``python -m marbles``, the
``if __name__ == '__main__'`` block won't get executed and the
logger won't get configured.
'''

def __init__(self):
@@ -1196,16 +1196,16 @@ def assertCategoricalLevelIn(self, level, levels, msg=None):
Parameters
----------
levels1
levels2 : iterable
level
levels : iterable
msg : str
If not provided, the :mod:`marbles.mixins` or
:mod:`unittest` standard message will be used.
Raises
------
TypeError
If ``levels2`` is not iterable.
If ``levels`` is not iterable.
'''
if not isinstance(levels, collections.Iterable):
raise TypeError('Second argument is not iterable')
@@ -1219,16 +1219,16 @@ def assertCategoricalLevelNotIn(self, level, levels, msg=None):
Parameters
----------
levels1
levels2 : iterable
level
levels : iterable
msg : str
If not provided, the :mod:`marbles.mixins` or
:mod:`unittest` standard message will be used.
Raises
------
TypeError
If ``levels2`` is not iterable.
If ``levels`` is not iterable.
'''
if not isinstance(levels, collections.Iterable):
raise TypeError('Second argument is not iterable')

0 comments on commit c346e8f

Please sign in to comment.