Skip to content

Commit bc559df

Browse files
authored
Merge pull request #485 from python-cmd2/sphinx_tests
Add tests which verify documentation build
2 parents 573d157 + 57e6bf0 commit bc559df

File tree

7 files changed

+22
-12
lines changed

7 files changed

+22
-12
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ matrix:
1616
- os: linux
1717
python: 3.7-dev
1818
env: TOXENV=py37
19+
- os: linux
20+
python: 3.5
21+
env: TOXENV=docs
1922
# # Warning: Don't try to use code coverage analysis with pypy as it is insanely slow
2023
# - os: linux
2124
# python: pypy3

cmd2/cmd2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,8 +1652,8 @@ def preparse(self, raw: str) -> str:
16521652
If you want a reliable pre parsing hook method, register a postparsing
16531653
hook, modify the user input, and then reparse it.
16541654
1655-
:param raw: raw command line input :return: potentially modified raw
1656-
command line input
1655+
:param raw: raw command line input :return: potentially modified raw command line input
1656+
:return: a potentially modified version of the raw input string
16571657
"""
16581658
return raw
16591659

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
# Add any paths that contain custom static files (such as style sheets) here,
103103
# relative to this directory. They are copied after the builtin static files,
104104
# so a file named "default.css" will overwrite the builtin "default.css".
105-
html_static_path = ['_static']
105+
html_static_path = []
106106

107107

108108
# -- Options for HTMLHelp output ------------------------------------------

docs/requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/alias_startup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
1) How to add custom command aliases using the alias command
55
2) How to load an initialization script at startup
66
"""
7-
7+
import os
88
import cmd2
99

1010
class AliasAndStartup(cmd2.Cmd):
1111
""" Example cmd2 application where we create commands that just print the arguments they are called with."""
1212

1313
def __init__(self):
14-
super().__init__(startup_script='.cmd2rc')
14+
alias_script = os.path.join(os.path.dirname(__file__), '.cmd2rc')
15+
super().__init__(startup_script=alias_script)
1516

1617

1718
if __name__ == '__main__':

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@
7373
# development only dependencies
7474
# install with 'pip install -e .[dev]'
7575
'dev': [
76-
'pytest', 'pytest-cov', 'tox', 'pylint', 'sphinx', 'sphinx-rtd-theme',
77-
'sphinx-autobuild', 'invoke', 'twine>=1.11',
76+
# for python 3.5 and earlier we need the third party mock module
77+
"mock ; python_version<'3.6'",
78+
'pytest', 'codecov', 'pytest-cov', 'pytest-mock', 'tox', 'pylint',
79+
'sphinx', 'sphinx-rtd-theme', 'sphinx-autobuild', 'invoke', 'twine>=1.11',
7880
]
7981
}
8082

tox.ini

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py34,py35,py36,py37,py35-win,py36-win,py37-win
2+
envlist = docs,py34,py35,py36,py37,py35-win,py36-win,py37-win
33

44
[pytest]
55
testpaths = tests
@@ -9,6 +9,14 @@ passenv = CI TRAVIS TRAVIS_* APPVEYOR*
99
setenv =
1010
PYTHONPATH={toxinidir}
1111

12+
[testenv:docs]
13+
basepython = python3.5
14+
deps =
15+
sphinx
16+
sphinx-rtd-theme
17+
changedir = docs
18+
commands = sphinx-build -a -W -T -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
19+
1220
[testenv:py34]
1321
deps =
1422
codecov

0 commit comments

Comments
 (0)