unittest setUp vs. pytest setup_class

unittest:

import unittest

class MyTest( unittest.TestCase ):
  def setUp( self ):
    self.variable = ...

pytest:

import pytest

class MyTest:
  @classmethod
  def setup_class( cls ):
    cls.variable = ...

Leave a Reply

Your email address will not be published. Required fields are marked *