def test_log(self, tmpdir, strTest, strLevel): objFile = tmpdir.mkdir("test").join("test.txt") logger.basicConfig(objFile.name) logger.log(strTest, strLevel) assert strTest in objFile.read()
def test_new(): assert logger.basicConfig( tmpdir.mkdir("test").join("test.txt"), 'w') == 'new'
def test_critical(self, tmpdir, strTest): objFile = tmpdir.mkdir("test").join("test.txt") logger.basicConfig(objFile.name) logger.critical(strTest) assert strTest in objFile.read()
def test_existing(tmpdir): assert logger.basicConfig( tmpdir.mkdir("test").join("test.txt")) == 'existing'