0

So, I created a small flask API. Basically a wrapper for another API. I used requests-futures to send multiple calls asynchronously.

I set up my virtual environment. Everything works exactly as I intend. However, when I try to run some tests I've written (using python -m unittest) this is the error I get:

======================================================================
ERROR: test (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/cwverica/take-home-apps/quixr/test.py", line 2, in <module>
    from app import app, session
  File "/home/cwverica/take-home-apps/quixr/app.py", line 3, in <module>
    from requests_futures.sessions import FuturesSession
ModuleNotFoundError: No module named 'requests_futures'

I have reinstalled the module using pip. I made sure to pip freeze > requirements.txt just in case it was reading module availability from there. But all in all I'm stumped. If anyone could help me out here, I'd greatly appreciate it.

CVerica
  • 327
  • 1
  • 10
  • Show us your folder/file structure and how you run the tests! – Klaus D. Nov 19 '21 at 05:09
  • @KlausD. Do you want the breakdown of my lib files as well, or just the basic structure? Also, I just looked at my lib files, and the folder name there is not the same as the module name. Would that mess me up? – CVerica Nov 19 '21 at 05:38

0 Answers0