"llama/git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "e9e5f61c45e13f9b87be985ae735de8c217e9915"
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
...@@ -33,7 +33,7 @@ script: ...@@ -33,7 +33,7 @@ script:
- yapf -r -d --style .style.yapf mmdet/ tools/ tests/ - yapf -r -d --style .style.yapf mmdet/ tools/ tests/
- python setup.py check -m -s - python setup.py check -m -s
- python setup.py build_ext --inplace - 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: after_success:
- coverage report - coverage report
\ No newline at end of file
...@@ -7,7 +7,7 @@ from .bbox_head import BBoxHead ...@@ -7,7 +7,7 @@ from .bbox_head import BBoxHead
@HEADS.register_module @HEADS.register_module
class ConvFCBBoxHead(BBoxHead): 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. separated branches.
/-> cls convs -> cls fcs -> cls /-> cls convs -> cls fcs -> cls
......
...@@ -71,7 +71,7 @@ class BasicResBlock(nn.Module): ...@@ -71,7 +71,7 @@ class BasicResBlock(nn.Module):
@HEADS.register_module @HEADS.register_module
class DoubleConvFCBBoxHead(BBoxHead): class DoubleConvFCBBoxHead(BBoxHead):
"""Bbox head used in Double-Head R-CNN r"""Bbox head used in Double-Head R-CNN
/-> cls /-> cls
/-> shared convs -> /-> shared convs ->
......
...@@ -64,6 +64,7 @@ def weighted_loss(loss_func): ...@@ -64,6 +64,7 @@ def weighted_loss(loss_func):
:Example: :Example:
>>> import torch
>>> @weighted_loss >>> @weighted_loss
>>> def l1_loss(pred, target): >>> def l1_loss(pred, target):
>>> return (pred - target).abs() >>> return (pred - target).abs()
......
...@@ -9,7 +9,7 @@ from ..utils import ConvModule ...@@ -9,7 +9,7 @@ from ..utils import ConvModule
@HEADS.register_module @HEADS.register_module
class FusedSemanticHead(nn.Module): class FusedSemanticHead(nn.Module):
"""Multi-level fused semantic segmentation head. r"""Multi-level fused semantic segmentation head.
in_1 -> 1x1 conv --- 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__': ...@@ -152,7 +152,7 @@ if __name__ == '__main__':
], ],
license='Apache License 2.0', license='Apache License 2.0',
setup_requires=['pytest-runner', 'cython', 'numpy'], setup_requires=['pytest-runner', 'cython', 'numpy'],
tests_require=['pytest'], tests_require=['pytest', 'xdoctest'],
install_requires=get_requirements(), install_requires=get_requirements(),
ext_modules=[ ext_modules=[
make_cython_ext( make_cython_ext(
......
...@@ -2,4 +2,5 @@ isort ...@@ -2,4 +2,5 @@ isort
flake8 flake8
yapf yapf
pytest-cov pytest-cov
codecov codecov
\ No newline at end of file xdoctest >= 0.10.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment