test: Filter warnings on testing

This commit is contained in:
Takeshi KOMIYA 2018-11-11 21:44:37 +09:00
parent 0f4514a69c
commit 0ccc64d9ea
4 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,8 @@ def test_extension_in_blacklist(app, status, warning):
@pytest.mark.sphinx(testroot='add_source_parser')
@pytest.mark.filterwarnings('ignore:The config variable "source_parsers"')
@pytest.mark.filterwarnings('ignore:app.add_source_parser\\(\\) does not support suffix')
def test_add_source_parser(app, status, warning):
assert set(app.config.source_suffix) == set(['.rst', '.md', '.test'])

View File

@ -1470,6 +1470,7 @@ def test_partialmethod(app):
@pytest.mark.sphinx('html', testroot='ext-autodoc')
@pytest.mark.filterwarnings('ignore:autodoc_default_flags is now deprecated.')
def test_merge_autodoc_default_flags1(app):
app.config.autodoc_default_flags = ['members', 'undoc-members']
merge_autodoc_default_flags(app, app.config)
@ -1478,6 +1479,7 @@ def test_merge_autodoc_default_flags1(app):
@pytest.mark.sphinx('html', testroot='ext-autodoc')
@pytest.mark.filterwarnings('ignore:autodoc_default_flags is now deprecated.')
def test_merge_autodoc_default_flags2(app):
app.config.autodoc_default_flags = ['members', 'undoc-members']
app.config.autodoc_default_options = {'members': 'this,that,order',

View File

@ -144,6 +144,7 @@ def test_get_catalogs_from_multiple_locale_dirs(tempdir):
assert domains == ['test1', 'test1', 'test2']
@pytest.mark.filterwarnings('ignore:gettext_compact argument')
def test_get_catalogs_with_compact(tempdir):
(tempdir / 'loc1' / 'xx' / 'LC_MESSAGES').makedirs()
(tempdir / 'loc1' / 'xx' / 'LC_MESSAGES' / 'test1.po').write_text('#')

View File

@ -34,6 +34,7 @@ def test_get_image_size(testroot):
assert get_image_size(testroot / TXT_FILENAME) is None
@pytest.mark.filterwarnings('ignore:The content argument')
def test_guess_mimetype(testroot):
# guess by filename
assert guess_mimetype('img.png') == 'image/png'