0

I am learning algorithms in leetcodes and usually have multiple testing in one TestCase

class TestCase(unittest.TestCase):
    """
    Tesing threeSum.py Solution class.
    """
    def setUp(self):
        self.solution = Solution()
    def test_1(self):
    def test_2(self):
    ...
   def test_3(self):

When I want to test one particular function, then have to comment others out.

Is there a solution to test a specified function in one TestCase?

Alice
  • 1,360
  • 2
  • 13
  • 28
  • https://stackoverflow.com/questions/15971735/running-single-test-from-unittest-testcase-via-command-line – pawelbylina Mar 26 '19 at 10:46
  • I cannot believe there exist such a powerful tool as unittest, amazing @9769953 – Alice Mar 26 '19 at 10:51
  • Then you haven't seen [pytest](https://pytest.org) yet, which is my current go-to testing tool (not built-in, but pretty much standard and easy to install). – 9769953 Mar 26 '19 at 11:05

0 Answers0