Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when invoking tests #70

Closed
eltbus opened this issue Jan 13, 2024 · 0 comments
Closed

Error when invoking tests #70

eltbus opened this issue Jan 13, 2024 · 0 comments

Comments

@eltbus
Copy link
Contributor

eltbus commented Jan 13, 2024

Error when running tests with Python 3.11 using inv test.

ERROR

Traceback (most recent call last):
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/bin/inv", line 8, in <module>
    sys.exit(program.run())
             ^^^^^^^^^^^^^
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/lib/python3.11/site-packages/invoke/program.py", line 373, in run
    self.parse_collection()
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/lib/python3.11/site-packages/invoke/program.py", line 465, in parse_collection
    self.load_collection()
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/lib/python3.11/site-packages/invoke/program.py", line 699, in load_collection
    module, parent = loader.load(coll_name)
                     ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/lib/python3.11/site-packages/invoke/loader.py", line 76, in load
    module = imp.load_module(name, fd, path, desc)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/eltbus/.pyenv/versions/3.11.5/lib/python3.11/imp.py", line 235, in load_module
    return load_source(name, filename, file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/eltbus/.pyenv/versions/3.11.5/lib/python3.11/imp.py", line 172, in load_source
    module = _load(spec)
             ^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 721, in _load
  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 "/Users/eltbus/Learnspace/python/python-multipart/tasks.py", line 16, in <module>
    @task
     ^^^^
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/lib/python3.11/site-packages/invoke/tasks.py", line 331, in task
    return klass(args[0], **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/lib/python3.11/site-packages/invoke/tasks.py", line 76, in __init__
    self.positional = self.fill_implicit_positionals(positional)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/lib/python3.11/site-packages/invoke/tasks.py", line 167, in fill_implicit_positionals
    args, spec_dict = self.argspec(self.body)
                      ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/eltbus/Learnspace/python/python-multipart/.venv/lib/python3.11/site-packages/invoke/tasks.py", line 153, in argspec
    spec = inspect.getargspec(func)
           ^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?

Solution is to update invoke from 1.7.3 to 2.0.0. See this issue.

Or install and run the tests with other Python version (i.e. 3.10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant