Using the 'set_log_path' hook on pytest 4.6.2 (Python 3.6.5) creates log files but does not write anything to them.
In conftest.py I write like #4707
@pytest.hookimpl(hookwrapper=True,tryfirst=True)
def pytest_runtest_setup(item):
config=item.config
logging_plugin=config.pluginmanager.get_plugin("logging-plugin")
full_fname=os.path.join("Report",item._request.node.name+".log")
logging_plugin.set_log_path(full_fname)
yield
After running the pytest command, there are some log files in the "Report" folder. But size of all log files is 0. My test code is like this:
def test_ok1():
logging.info("ok1")
def test_ok2():
logging.info("ok2")
Using the 'set_log_path' hook on pytest 4.6.2 (Python 3.6.5) creates log files but does not write anything to them.
In
conftest.pyI write like #4707After running the
pytestcommand, there are some log files in the "Report" folder. But size of all log files is 0. My test code is like this: