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

Failed tests with ImportError: cannot import name 'Iterable' from 'collections' #14

Closed
krotoff opened this issue Feb 15, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@krotoff
Copy link

krotoff commented Feb 15, 2022

Failed tests
I have failed tests on step 5.

Describe your environment

  • MacOS 12.0.1 Monterrey
  • Python 3.10.2
  • Google Chrome 94.0.4606.81
  • Branch dev/1.1.0

To Reproduce

  1. $git clone https://github.com/glato/emerge.git
  2. $brew install graphviz
  3. $cd emerge
  4. $pip3 install virtualenv
  5. $virtualenv -p python3 venv
  6. $source venv/bin/activate
  7. $pip install -r requirements.txt
  8. $python emerge/tests/run_tests.py

Expected behavior
Successful tests

Reality

Traceback (most recent call last):
  File "/Users/akrotov/Downloads/emerge/emerge/tests/run_tests.py", line 9, in <module>
    from interrogate import coverage
  File "/Users/akrotov/Downloads/emerge/venv/lib/python3.10/site-packages/interrogate/coverage.py", line 10, in <module>
    import tabulate
  File "/Users/akrotov/Downloads/emerge/venv/lib/python3.10/site-packages/tabulate.py", line 16, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
@krotoff krotoff added the bug Something isn't working label Feb 15, 2022
@glato
Copy link
Owner

glato commented Feb 15, 2022

Hi @krotoff 👋, thanks for the feedback. You seem to be right. As a matter of fact, I was able to solve this first issue by simply upgrading tabulate:

pip install tabulate==0.8.9 -U

since there seems to be a bug related to python 3.10, but unfortunately another issue came up. It seems there is a problem with the current import module structure when executing the unit tests from the command line. The interesting part is, this seems to work pretty fine by using test discovery and execution within vscode:

CleanShot 2022-02-15 at 21 24 03@2x

Will have to check this in detail in the following days. Maybe I need to implement unit tests for the unit tests 👀.

@krotoff
Copy link
Author

krotoff commented Feb 16, 2022

Hello, @glato!

Recursion as it is :)

@glato
Copy link
Owner

glato commented Feb 27, 2022

@krotoff Had the time to figure out, how to manually get the tests running from the command line again. While in the project root directory, simply do a

python -m unittest discover -v -s ./emerge -p "test_*.py"

This should hopefully start and run all present tests and give an output that ends similar to

Ran 21 tests in 1.046s

OK

I will update requirements.txt and setup.py to match tabulate 0.8.9, update the README and adjust run_tests.py in the next release. Will make a small README update before the next release that mentions the command line version.

Thanks again for the hint.

@krotoff
Copy link
Author

krotoff commented Feb 28, 2022

@glato glad to hear it and to help :)

@glato
Copy link
Owner

glato commented Mar 7, 2022

@krotoff Updated tabulate, unit tests and README in the current release 1.2.0 so that it should be working fine again.

@glato glato closed this as completed Mar 7, 2022
@krotoff
Copy link
Author

krotoff commented Mar 10, 2022

@glato thank you! Tests are working now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants