'How to prevent pytest from capturing log messages when -m flag is used

I am using pytest -s for displaying log messages to the console. It works fine for individual pytest. But when used with pytest -s -m option, it does not work.

pytest -s -m sdk

does not output to console. How do I get it to work?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source