Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michiel Cottaar
fslpy
Commits
3f0d400d
Commit
3f0d400d
authored
May 03, 2017
by
Paul McCarthy
Browse files
Using pytest-html to generate a test report
parent
7a9afbce
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
3f0d400d
...
...
@@ -35,8 +35,10 @@ guide](doc/contributing.rst).
Tests
-----
To run the tests, install
`pytest`
and
`pytest-cov`
, and then run:
To run the tests, install
`mock`
,
`pytest`
,
`pytest-runner`
,
`pytest-html`
,
and
`pytest-cov`
, and then run:
python setup.py test
A code coverage report will be generated in
`htmlcov/`
.
A test report will be generated at
`report.html`
, and a code coverage report
will be generated in
`htmlcov/`
.
pytest.ini
View file @
3f0d400d
[pytest]
testpaths
=
tests
addopts
=
-v --niters=50 --cov=fsl --cov-report=html
addopts
=
-s
-v --niters=50 --cov=fsl --cov-report=html
--html=report.html
setup.py
View file @
3f0d400d
...
...
@@ -37,7 +37,7 @@ with open(op.join(basedir, "fsl", "version.py")) as f:
for
line
in
f
:
if
line
.
startswith
(
'__version__'
):
exec
(
line
,
version
)
break
break
with
open
(
op
.
join
(
basedir
,
'README.md'
),
'rt'
)
as
f
:
readme
=
f
.
read
()
...
...
@@ -45,9 +45,9 @@ with open(op.join(basedir, 'README.md'), 'rt') as f:
class
doc
(
Command
):
"""Build the API documentation. """
user_options
=
[]
def
initialize_options
(
self
):
pass
...
...
@@ -64,12 +64,12 @@ class doc(Command):
env
=
dict
(
os
.
environ
)
ppath
=
[
op
.
join
(
pkgutil
.
get_loader
(
'fsl'
).
filename
,
'..'
)]
env
[
'PYTHONPATH'
]
=
op
.
pathsep
.
join
(
ppath
)
print
(
'Building documentation [{}]'
.
format
(
destdir
))
sp
.
call
([
'sphinx-build'
,
docdir
,
destdir
],
env
=
env
)
sp
.
call
([
'sphinx-build'
,
docdir
,
destdir
],
env
=
env
)
setup
(
...
...
@@ -102,7 +102,11 @@ setup(
install_requires
=
install_requires
,
setup_requires
=
[
'pytest-runner'
],
tests_require
=
[
'pytest'
,
'mock'
,
'pytest-cov'
,
'pytest-runner'
],
tests_require
=
[
'pytest'
,
'mock'
,
'pytest-cov'
,
'pytest-html'
,
'pytest-runner'
],
test_suite
=
'tests'
,
cmdclass
=
{
'doc'
:
doc
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment