Skip to content
Snippets Groups Projects
Commit 0e9de200 authored by Jon Crall's avatar Jon Crall Committed by Kai Chen
Browse files

Enable doctests in CI with xdoctest (#1479)

* Enable doctests in CI with xdoctest

* use xdoctest in travis file

* Fix doctest warnings

* dont test eggs directory

* Ensure xdoctest is installed before running CI
parent d9f4f254
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ script:
- yapf -r -d --style .style.yapf mmdet/ tools/ tests/
- python setup.py check -m -s
- python setup.py build_ext --inplace
- coverage run --source mmdet -m py.test tests -v --doctest-modules
- coverage run --source mmdet -m py.test -v --xdoctest-modules tests mmdet
after_success:
- coverage report
\ No newline at end of file
- coverage report
......@@ -7,7 +7,7 @@ from .bbox_head import BBoxHead
@HEADS.register_module
class ConvFCBBoxHead(BBoxHead):
"""More general bbox head, with shared conv and fc layers and two optional
r"""More general bbox head, with shared conv and fc layers and two optional
separated branches.
/-> cls convs -> cls fcs -> cls
......
......@@ -71,7 +71,7 @@ class BasicResBlock(nn.Module):
@HEADS.register_module
class DoubleConvFCBBoxHead(BBoxHead):
"""Bbox head used in Double-Head R-CNN
r"""Bbox head used in Double-Head R-CNN
/-> cls
/-> shared convs ->
......
......@@ -64,6 +64,7 @@ def weighted_loss(loss_func):
:Example:
>>> import torch
>>> @weighted_loss
>>> def l1_loss(pred, target):
>>> return (pred - target).abs()
......
......@@ -9,7 +9,7 @@ from ..utils import ConvModule
@HEADS.register_module
class FusedSemanticHead(nn.Module):
"""Multi-level fused semantic segmentation head.
r"""Multi-level fused semantic segmentation head.
in_1 -> 1x1 conv ---
|
......
[pytest]
addopts = --xdoctest --xdoctest-style=auto
norecursedirs = .git ignore build __pycache__ data docker docs .eggs
filterwarnings= default
ignore:.*No cfgstr given in Cacher constructor or call.*:Warning
ignore:.*Define the __nice__ method for.*:Warning
......@@ -152,7 +152,7 @@ if __name__ == '__main__':
],
license='Apache License 2.0',
setup_requires=['pytest-runner', 'cython', 'numpy'],
tests_require=['pytest'],
tests_require=['pytest', 'xdoctest'],
install_requires=get_requirements(),
ext_modules=[
make_cython_ext(
......
......@@ -2,4 +2,5 @@ isort
flake8
yapf
pytest-cov
codecov
\ No newline at end of file
codecov
xdoctest >= 0.10.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment