title: Wait on an ordinary function which calls an async function
body: <p>For a project, I want to be able to have simultaneously a sync and async version of a library, the sync version has most logic parts and the async must call the sync version in a async way. For example I have a class which gets an http requester in constructor, this requester handle sync or async internally:</p>
  
  <pre><code>    .
  ├── async
  │   └── foo.py
  ├── foo.py
  └── main.py
  └── requester.py
  
  # requester.py
  class Requester():
      def connect():
          return self._connect('some_address')
  
  class AsynRequester():
      async def connect():
          return await self._connect('some_address')
  
  # foo.py                                                                                                                                              
  class Foo:
      def __init__(self, requester):
          self._requester = requester
  
      def connect(self):
          self.connect_info = self._requester.connect('host') # in async version it would be called by an await internally
  
  # async/foo.py                                                                                                                                        
  from foo import Foo as RawFoo
  
  class Foo(RawFoo):
      async def connect(self):
          return await super(RawFoo, self).connect()
  
  # main.py                                                                                                                                             
  from async.foo import Foo # from foo import Foo                                                                                                       
  from requester import AsynRequester # from requester import Requester
  
  def main():
      f = Foo(AsyncRequester()) # or Foo(Requester()) where we use sync requester
  
      await f.connect() # or f.connect() if we are using sync methods    
  </code></pre>
  
  <p>But async <code>connect</code> finally calls the sync connect of sync class type of <code>Foo</code> (which is parent of async class) which internally calls <code>requester.connect</code> function. It is impossible because <code>requester.connect</code> internally has called <code>await connect</code> when it had being used in async mode but it is calling without any await.</p>
  
  <p>All of my tests have been written for sync version, because async tests is not efficient as they must be, also I must write tests for one version and be sure that both versions would work correctly. How can I have both version at the same time which are using the same logic and just the I/O calls are separated.</p>