Happy new year!
Using the dev docker containers stack locally:
bench --site development.localhost list-apps
frappe 15.x.x-develop () develop
erpnext 15.x.x-develop () develop
bench --site development.localhost run-tests
Failed to discover tests for [‘frappe’, ‘erpnext’]: No module named ‘responses’
I read Unit testing framework is down ? · Issue #27584 · frappe/frappe · GitHub which is the same issue, the response is to use a local server … which was the case of the OP, and is the same setup I run.
Where is this responses module?
EDIT:
Same issue on a freshly installed prod docker setup (12 containers):
Commands restricted in prodution container, Read FAQ before you proceed: https://frappe.fyi/ctr-faq
frappe@0615204a1534:~/frappe-bench$ ls
apps config env logs patches.txt sites
frappe@0615204a1534:~/frappe-bench$ bench --site frontend run-tests
Testing is disabled for the site!
You can enable tests by entering following command:
bench --site frontend set-config allow_tests true
frappe@0615204a1534:~/frappe-bench$ bench --site frontend set-config allow_tests true
frappe@0615204a1534:~/frappe-bench$ bench --site frontend run-tests
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
click.Group(commands=commands)(prog_name="bench")
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py", line 790, in run_tests
ret = frappe.test_runner.main(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 111, in main
ret = run_all_tests(app, verbose, profile, failfast=failfast, junit_xml_output=junit_xml_output)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 162, in run_all_tests
_add_test(app, path, filename, verbose, test_suite)
File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 313, in _add_test
module = importlib.import_module(module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/webhook/test_webhook.py", line 6, in <module>
import responses
ModuleNotFoundError: No module named 'responses'
I forgot to say: yes, I checked the box:
on prod, I also tried to force re-install erpnext and run-tests again:
frappe@0615204a1534:~/frappe-bench$ bench --site frontend list-apps
frappe 15.51.0 UNVERSIONED
erpnext 15.47.1 UNVERSIONED