コード例 #1
0
 def test_configure_once_issues_warning_on_repeated_call(self):
     with warnings.catch_warnings(record=True) as warns:
         configure_once()
     assert 0 == len(warns)
     with warnings.catch_warnings(record=True) as warns:
         configure_once()
     assert 1 == len(warns)
     assert RuntimeWarning == warns[0].category
     assert "Repeated configuration attempted." == warns[0].message.args[0]
コード例 #2
0
ファイル: test_config.py プロジェクト: hynek/structlog
 def test_configure_once_issues_warning_on_repeated_call(self):
     with warnings.catch_warnings(record=True) as warns:
         configure_once()
     assert 0 == len(warns)
     with warnings.catch_warnings(record=True) as warns:
         configure_once()
     assert 1 == len(warns)
     assert RuntimeWarning == warns[0].category
     assert "Repeated configuration attempted." == warns[0].message.args[0]