-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
python3: tests collecting fails with TypeError: object of type 'map' has no len() #3325
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
Comments
In python3 you can't do:
the fix is to convert map into a list:
|
GitMate.io thinks possibly related issues are #638 (python.py:813 (in "parametrize") raises "TypeError: object of type 'int' has no len()" in some cases), #651 (test fails in ntpath.py when LocalPath has no len), #747 (flakes test fail), #1777 (sigalrm fails test), and #239 (not collect deselected tests). |
I don't think passing anything other than a sequence to |
I can submit PR, there are just two occurences to fix: |
RE passing anything other than a sequence to parametrize Why then with python2.7 there is no problem to collect such tests? |
Trying to "fix" this in pytest will probably have wider implications - you should really just use the pytest API like documented, which means passing a list (or at least some kind of sequence) to pytest.
Because |
Ok we can fix it then probably ourselves by changing map to list in our code. Yay |
note that both points in pytest would fix it wrong and break on marker reuse and/or double call |
but we should probably assert that we get an actual sequence there, |
Thanks guys I'm happy with closing this issue now |
Uh oh!
There was an error while loading. Please reload this page.
There is one test that cause collector to fail on python3:
Collector is not python3 ready as it fails when collecting tests with the following mark
@pytest.mark.parametrize()
The text was updated successfully, but these errors were encountered: