It has been resolved when I used "Pytest Runner for Visual Studio Code" test explorer instead of "Python Test for VS code" test explorer