Ensure doctesting and doc8 testing done in py27 env

This ensures that sphinx doc tests are ran and validated
and also runs doc8 to ensure style checks are done and adjusts
some of the current examples and code to fix found issues.

Also fixes the `get_callback_name` method which needs to check
if the __module__ is non-none (since it appears sphinx somehow
triggers it being none).

Change-Id: I54daecff219a9e9be71ff382d36fc2d5e67360cf
This commit is contained in:
Joshua Harlow 2015-07-14 10:49:49 -07:00
parent 3111444bd5
commit 01ee0381fe
5 changed files with 12 additions and 1 deletions

1
ChangeLog Normal file
View File

@ -0,0 +1 @@
.. This is a generated file! Do not edit.

View File

@ -42,7 +42,9 @@ def get_callback_name(cb):
return repr(cb)
else:
try:
segments.insert(0, cb.__module__)
# When running under sphinx it appears this can be none?
if cb.__module__:
segments.insert(0, cb.__module__)
except AttributeError:
pass
return ".".join(segments)

View File

@ -42,6 +42,7 @@ Transitioning a simple machine
m.process_event('fall')
print(m.pformat())
print(m.current_state)
print(m.terminated)
**Expected output:**

View File

@ -4,6 +4,7 @@
hacking<0.11,>=0.10.0
doc8 # Apache-2.0
coverage>=3.6
discover
python-subunit>=0.0.18

View File

@ -21,6 +21,12 @@ commands = python setup.py test --slowest --testr-args='{posargs}'
[testenv:pep8]
commands = flake8 {posargs}
[testenv:py27]
commands =
python setup.py testr --slowest --testr-args='{posargs}'
sphinx-build -b doctest doc/source doc/build
doc8 doc/source
[testenv:venv]
basepython = python2.7
commands = {posargs}