title: Unable to run unit test from importing function - Python
body: <p>I feel like I may be missing something very obvious here, but when I create a class for a unit test within my main Python file I am able to run the unit test successfully. However, when I try to import the class into a separate test.py file, there is absolutely no output. The two .py files are located in the same directory. Here is some of the code from the test file:</p>
  <pre><code>import sys
  sys.path.append('/path/to/files')
  import unittest
  from mainfilename import Fraction
  
  #Class for unit test
  class TestOperatorEval(unittest.TestCase):
  
      #Create instances of Fractions
      def SetUp(self):
          self.Fraction = Fraction()
  
      #For successful test cases
      def test_OperatorEval_success(self) -&gt; None:
          # Fractions to test
          f49: Fraction = Fraction(4, 9)
          f15: Fraction = Fraction(1, 5)
          f2945: Fraction = Fraction(29, 45)
  
          self.assertEqual(f49.__add__(f15), f2945)
      
  if __name__ == '__main__':
      unittest.main()
      main()
  
  </code></pre>
  <p>This same block of code runs perfectly fine with a passed test when it's in the main file. What could I do next to troubleshoot?</p>
  <p>Edit: Fraction is a class created to perform mathematical operations on fractions, e.g.:</p>
  <pre><code>#Define the Fraction class
  class Fraction:
      #Method for the numerator and denominator
      def __init__(self, numerator: float, denominator: float) -&gt; None:
          #Store numerator and denominator
          self.num: float = numerator
          self.denom: float = denominator
  
      def __str__(self) -&gt; str:
          #Return instances of Fraction in desired format
          return str(self.num)+&quot;/&quot;+str(self.denom)
  
      #Method to sum fractions
      def __add__(self, otherFraction: object) -&gt; &quot;Fraction&quot;:
          #Get numerator of new fraction
          othernumerator: float = self.num * otherFraction.denom + self.denom * otherFraction.num
          #Get denominator of new fraction
          otherdenominator: float = self.denom * otherFraction.denom
          #Return instance of fraction
          return Fraction(othernumerator, otherdenominator)
  </code></pre>