supress conflicting regex warning
This commit is contained in:
parent
ed25fc2eeb
commit
c68d81a8ca
1 changed files with 5 additions and 2 deletions
|
@ -84,6 +84,8 @@ def _reset_config():
|
||||||
|
|
||||||
|
|
||||||
def test_active_modules() -> None:
|
def test_active_modules() -> None:
|
||||||
|
import pytest
|
||||||
|
|
||||||
reset = _reset_config
|
reset = _reset_config
|
||||||
|
|
||||||
with reset() as cc:
|
with reset() as cc:
|
||||||
|
@ -104,7 +106,8 @@ def test_active_modules() -> None:
|
||||||
cc.enabled_modules = ['my.body.exercise']
|
cc.enabled_modules = ['my.body.exercise']
|
||||||
assert cc._is_module_active('my.whatever' ) is None
|
assert cc._is_module_active('my.whatever' ) is None
|
||||||
assert cc._is_module_active('my.core' ) is None
|
assert cc._is_module_active('my.core' ) is None
|
||||||
assert cc._is_module_active('my.body.exercise') is True
|
with pytest.warns(UserWarning, match=r"conflicting regexes") as record_warnings:
|
||||||
# todo suppress warnings during the tests?
|
assert cc._is_module_active("my.body.exercise") is True
|
||||||
|
assert len(record_warnings) == 1
|
||||||
|
|
||||||
### tests end
|
### tests end
|
||||||
|
|
Loading…
Add table
Reference in a new issue