title: How to test a function with functional test?
body: <p>I want to perform a functional test, but the purpose of this test is to check the result of another function - <code>need_to_test</code>, it should not be a module test, I want to make sure that when starting <code>test_func</code>, another function, namely <code>need_to_test</code>, returns the result I need.</p>
  <pre><code>class Need_test_func:
      def need_to_test(self):
          return 'Red'
  
      def start_another_funk(self):
          return self.need_to_test() + ' Green'
  
      def test_func(self):
          self.start_another_funk()
          return
  </code></pre>
  <pre><code>def test_check():
      need_test_func = Need_test_func()
      color = 'Red'
      
      assert next(need_test_func().test_func()) == 'Red Green'
  </code></pre>
  <p>my task is to write a functional test i.e. start working with the Need_test_func class from the test_func function and make sure that it works properly but I can't do a unit test and just check if need_to_test returns the right color I need to start with test_func and make sure that during the operation of this function, need_to_test is launched and returns the value I need
  How i can do this?</p>