なぜこれが起こりますか? 重複コール なぜpytestは重複したメソッドを呼び出すのですか
コード
import logging, logging.handlers
class TestCase:
def setup_method(self,test_method):
self.log = logging.getLogger('test')
self.log.addHandler(logging.StreamHandler())
def test_one(self):
log = self.log
log.info('one')
def test_two(self):
log = self.log
log.info('two')
コンソールアウト
$pytest -s
=========================================== test session starts ===========================================
platform darwin -- Python 3.6.2, pytest-3.3.1, py-1.5.2, pluggy-0.6.0
rootdir: /Users/taeun/dev/workspace/test/pytest-test/tests, inifile:
collected 2 items
test_one.py one
.two
two
. [100%]
私は "self.log" を追加したので、誰も私を助けて?
ソースコードをイメージではなくテキストとして貼り付けてください。 –
直前に更新します!ありがとうございます – taeun