Newly created test is using the wrong testing framework

Answered

I have py.test setup as my default testing framework. When I hit CTRL+SHIFT+T and select the create a new test option, the new test gets created in the format of a unittest framework test. How can I get it to be created in the py.test format?

For example, create a new project and go to settings and set the default test runner to py.test

Then create a class:

class Sample:
   def do_something(self):
      pass

Put the cursor in the class and hit CTRL+SHIFT+T. Select create new test and check the test_do_something test method and hit OK.

The created test will be:

from unittest import TestCase

class TestSample(TestCase):
    def test_do_something(self):
        self.fail()
 
Since we are setup to use py.test and not unittest, seems like the expected result would be more like the following?
 
import pytest

class TestSample:
    def test_do_something(self):
        pytest.fail()
 
Is there something I am configuring wrong or a way I can mod the create a test template?
0
1 comment

Please sign in to leave a comment.