summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-09-24 09:15:07 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-10-16 10:34:59 +0900
commit7e23a061b313a7dd844aae463e7ad223b16125b9 (patch)
treed13971ca1581044aac267b09e060b14d02ee0ff7
parent84e1eeb8a2dd7092759471fd2e4525e7f0cbb8a5 (diff)
downloadsphinx-git-7e23a061b313a7dd844aae463e7ad223b16125b9.tar.gz
Fix typo
-rw-r--r--sphinx/environment/__init__.py2
-rw-r--r--sphinx/project.py2
-rw-r--r--tests/test_project.py20
3 files changed, 12 insertions, 12 deletions
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py
index 7be84ab29..52cf7fa95 100644
--- a/sphinx/environment/__init__.py
+++ b/sphinx/environment/__init__.py
@@ -390,7 +390,7 @@ class BuildEnvironment:
exclude_paths = (self.config.exclude_patterns +
self.config.templates_path +
builder.get_asset_paths())
- self.project.discovery(exclude_paths)
+ self.project.discover(exclude_paths)
# Current implementation is applying translated messages in the reading
# phase.Therefore, in order to apply the updated message catalog, it is
diff --git a/sphinx/project.py b/sphinx/project.py
index ed910088e..82ea54ef3 100644
--- a/sphinx/project.py
+++ b/sphinx/project.py
@@ -44,7 +44,7 @@ class Project(object):
"""Take over a result of last build."""
self.docnames = other.docnames
- def discovery(self, exclude_paths=[]):
+ def discover(self, exclude_paths=[]):
# type: (List[unicode]) -> Set[unicode]
"""Find all document files in the source directory and put them in
:attr:`docnames`.
diff --git a/tests/test_project.py b/tests/test_project.py
index 3b48c2de3..3ae00ef4e 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -16,7 +16,7 @@ import pytest
from sphinx.project import Project
-def test_project_discovery(rootdir):
+def test_project_discover(rootdir):
project = Project(rootdir / 'test-root', {})
docnames = {'autodoc', 'bom', 'extapi', 'extensions', 'footnote', 'images',
@@ -26,29 +26,29 @@ def test_project_discovery(rootdir):
# basic case
project.source_suffix = ['.txt']
- assert project.discovery() == docnames
+ assert project.discover() == docnames
# exclude_paths option
- assert project.discovery(['subdir/*']) == docnames - subdir_docnames
+ assert project.discover(['subdir/*']) == docnames - subdir_docnames
# exclude_patterns
- assert project.discovery(['.txt', 'subdir/*']) == docnames - subdir_docnames
+ assert project.discover(['.txt', 'subdir/*']) == docnames - subdir_docnames
# multiple source_suffixes
project.source_suffix = ['.txt', '.foo']
- assert project.discovery() == docnames | {'otherext'}
+ assert project.discover() == docnames | {'otherext'}
# complicated source_suffix
project.source_suffix = ['.foo.png']
- assert project.discovery() == {'img'}
+ assert project.discover() == {'img'}
# templates_path
project.source_suffix = ['.html']
- assert project.discovery() == {'_templates/layout',
- '_templates/customsb',
- '_templates/contentssb'}
+ assert project.discover() == {'_templates/layout',
+ '_templates/customsb',
+ '_templates/contentssb'}
- assert project.discovery(['_templates']) == set()
+ assert project.discover(['_templates']) == set()
@pytest.mark.sphinx(testroot='basic')