pabot icon indicating copy to clipboard operation
pabot copied to clipboard

TypeError: range() integer step argument expected, got float.

Open theodore86 opened this issue 4 years ago • 5 comments

Hi,

Recently i have upgrade the Robot framework to version 3.2.1 (python 2.7.17) and it seems that my old stable version of pabot == 0.96 version is not compatible anymore due to parser changes in robot framework. I have decide to upgrade Pabot to version 1.3.0.

I am not sure if this is an known issue but i am receiving the below unhandle exception:

rfdryrun run-test: commands[1] | pabot --extension robot --dryrun --exclude NoDryRun -d /home/vagrant/repo/logs/pabot_results testcases
Storing .pabotsuitenames file
[ERROR] EXCEPTION RAISED DURING PABOT EXECUTION
[ERROR] PLEASE CONSIDER REPORTING THIS ISSUE TO https://github.com/mkorpela/pabot/issues
Total testing: 0.0 seconds
Elapsed time:  3.63 seconds
Traceback (most recent call last):
  File "/home/vagrant/logs/.tox/rfdryrun/bin/pabot", line 11, in <module>
    sys.exit(main())
  File "/home/vagrant/repo/.tox/rfdryrun/lib/python2.7/site-packages/pabot/pabot.py", line 1616, in main
    options, opts_for_run, pabot_args):
  File "/home/vagrant/repo/.tox/rfdryrun/lib/python2.7/site-packages/pabot/pabot.py", line 1481, in _create_execution_items
    all_items = _create_execution_items_for_dry_run(suite_names, datasources, outs_dir, opts_for_run, pabot_args)
  File "/home/vagrant/repo/.tox/rfdryrun/lib/python2.7/site-packages/pabot/pabot.py", line 1522, in _create_execution_items_for_dry_run
    chunked_items = list(_chunk_items(items, chunk_size))
  File "/home/vagrant/repo/.tox/rfdryrun/lib/python2.7/site-packages/pabot/pabot.py", line 1528, in _chunk_items
    for i in range(0, len(items), chunk_size):
TypeError: range() integer step argument expected, got float.

The same exception is being raised at version 1.8.0:

  File "/home/vagrant/repo/.tox/rfdryrun/lib/python2.7/site-packages/pabot/pabot.py", line 1219, in _chunk_items
    for i in range(0, len(items), chunk_size):
TypeError: range() integer step argument expected, got float.

This error seems to be appeared after Pabot version 1.2.0 in conjuction with robot-framework==3.2.1

Thanks, Theodore G.

theodore86 avatar Jun 04 '20 09:06 theodore86

Thanks Theodore for the report!

mkorpela avatar Jun 04 '20 09:06 mkorpela

Thank you for your time!

theodore86 avatar Jun 04 '20 09:06 theodore86

Looks like Python2 behavior here: https://github.com/mkorpela/pabot/blob/cba0338b5d2b5742e21e00e7e44990e753627a01/pabot/pabot.py#L1211 round returns float value

tmarenko avatar Jun 09 '20 20:06 tmarenko

Replacing round with int will solve the issue.

theodore86 avatar Jun 10 '20 06:06 theodore86

Hi @mkorpela,

It seems that solving this issue will unblock the upgrade of pabot library up to version 1.8.0 and the usage of robotframework>=3.2.0 having python2.x. I had made some tests with pabot version>0.96 and <1.8.0 and something is wrong with the generation of .pabotsuitenames file (is taking too long to be generated, need further investigation) which seems to be fixed at v1.8.0.

To sum up, due this issue the latest stable python2.x release is pabot==0.96 (robotframework==3.1.1), is there any plan to be fixed in the next pabot releases?

Thank you in advance, Theodore G.

theodore86 avatar Jul 05 '20 19:07 theodore86