Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
fslpy
Commits
3f0d400d
Commit
3f0d400d
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Using pytest-html to generate a test report
parent
7a9afbce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+4
-2
4 additions, 2 deletions
README.md
pytest.ini
+1
-1
1 addition, 1 deletion
pytest.ini
setup.py
+10
-6
10 additions, 6 deletions
setup.py
with
15 additions
and
9 deletions
README.md
+
4
−
2
View file @
3f0d400d
...
@@ -35,8 +35,10 @@ guide](doc/contributing.rst).
...
@@ -35,8 +35,10 @@ guide](doc/contributing.rst).
Tests
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
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/`
.
This diff is collapsed.
Click to expand it.
pytest.ini
+
1
−
1
View file @
3f0d400d
[pytest]
[pytest]
testpaths
=
tests
testpaths
=
tests
addopts
=
-v --niters=50 --cov=fsl --cov-report=html
addopts
=
-s
-v --niters=50 --cov=fsl --cov-report=html
--html=report.html
This diff is collapsed.
Click to expand it.
setup.py
+
10
−
6
View file @
3f0d400d
...
@@ -37,7 +37,7 @@ with open(op.join(basedir, "fsl", "version.py")) as f:
...
@@ -37,7 +37,7 @@ with open(op.join(basedir, "fsl", "version.py")) as f:
for
line
in
f
:
for
line
in
f
:
if
line
.
startswith
(
'
__version__
'
):
if
line
.
startswith
(
'
__version__
'
):
exec
(
line
,
version
)
exec
(
line
,
version
)
break
break
with
open
(
op
.
join
(
basedir
,
'
README.md
'
),
'
rt
'
)
as
f
:
with
open
(
op
.
join
(
basedir
,
'
README.md
'
),
'
rt
'
)
as
f
:
readme
=
f
.
read
()
readme
=
f
.
read
()
...
@@ -45,9 +45,9 @@ with open(op.join(basedir, 'README.md'), 'rt') as f:
...
@@ -45,9 +45,9 @@ with open(op.join(basedir, 'README.md'), 'rt') as f:
class
doc
(
Command
):
class
doc
(
Command
):
"""
Build the API documentation.
"""
"""
Build the API documentation.
"""
user_options
=
[]
user_options
=
[]
def
initialize_options
(
self
):
def
initialize_options
(
self
):
pass
pass
...
@@ -64,12 +64,12 @@ class doc(Command):
...
@@ -64,12 +64,12 @@ class doc(Command):
env
=
dict
(
os
.
environ
)
env
=
dict
(
os
.
environ
)
ppath
=
[
op
.
join
(
pkgutil
.
get_loader
(
'
fsl
'
).
filename
,
'
..
'
)]
ppath
=
[
op
.
join
(
pkgutil
.
get_loader
(
'
fsl
'
).
filename
,
'
..
'
)]
env
[
'
PYTHONPATH
'
]
=
op
.
pathsep
.
join
(
ppath
)
env
[
'
PYTHONPATH
'
]
=
op
.
pathsep
.
join
(
ppath
)
print
(
'
Building documentation [{}]
'
.
format
(
destdir
))
print
(
'
Building documentation [{}]
'
.
format
(
destdir
))
sp
.
call
([
'
sphinx-build
'
,
docdir
,
destdir
],
env
=
env
)
sp
.
call
([
'
sphinx-build
'
,
docdir
,
destdir
],
env
=
env
)
setup
(
setup
(
...
@@ -102,7 +102,11 @@ setup(
...
@@ -102,7 +102,11 @@ setup(
install_requires
=
install_requires
,
install_requires
=
install_requires
,
setup_requires
=
[
'
pytest-runner
'
],
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
'
,
test_suite
=
'
tests
'
,
cmdclass
=
{
'
doc
'
:
doc
},
cmdclass
=
{
'
doc
'
:
doc
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment