You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is a user error, because I've had Ward working before, but for some reason, it's now complaining about pytest not being found. Does Ward expect the user to have this installed on their system or am I doing something incorrect here?
(virtual_environment) josephlyons@Josephs-MacBook-Pro key-bindings % ward
Traceback (most recent call last):
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/bin/ward", line 8, in <module>
sys.exit(run())
^^^^^
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/lib/python3.11/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/lib/python3.11/site-packages/ward/_run.py", line 200, in test
modules = load_modules(mod_infos)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/josephlyons/Work/docs/script/key-bindings/virtual_environment/lib/python3.11/site-packages/ward/_collect.py", line 152, in load_modules
m.__loader__.exec_module(m)
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/josephlyons/Work/docs/script/settings/virtual_environment/lib/python3.11/site-packages/numpy/tests/test_ctypeslib.py", line 2, in <module>
import pytest
ModuleNotFoundError: No module named 'pytest'
The text was updated successfully, but these errors were encountered:
When you run ward it has to find tests, so it recursively searches directories for Python files. Since your virtual env is in the same directory, it looks in there and finds a lots of Python files and loads them to find tests.
If you explicitly pass the path to ward with ward --path path/to/src then it should avoid this issue. I suspect renaming your virtualenv folder to .venv might also work - I think ward specifically ignores that folder name as it's a common convention (could be wrong on that though).
I think this is a user error, because I've had Ward working before, but for some reason, it's now complaining about pytest not being found. Does Ward expect the user to have this installed on their system or am I doing something incorrect here?
The text was updated successfully, but these errors were encountered: