-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
plugin: capturerelated to the capture builtin pluginrelated to the capture builtin pluginplugin: loggingrelated to the logging builtin pluginrelated to the logging builtin plugintopic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytype: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity
Description
Hi pytest-experts :)
i like to use the caplog fixture in another fixture with session scope:
import pytest
import logging
@pytest.fixture(scope='session')
def my_log(caplog):
caplog.set_level(logging.INFO)
def test_foo(my_log):
passThis results in the following error:
ScopeMismatch: You tried to access the 'function' scoped fixture 'caplog' with a 'session' scoped request object, involved factories
nickeldan
Metadata
Metadata
Assignees
Labels
plugin: capturerelated to the capture builtin pluginrelated to the capture builtin pluginplugin: loggingrelated to the logging builtin pluginrelated to the logging builtin plugintopic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytype: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity