qase-tms/qase-python

qaseio.exceptions.ApiTypeError: Invalid type for variable 'id'. Required value type is int and passed type was str at ['id']

Closed this issue · 3 comments

Getting the following error when running pytest using following command:

Launching pytest with arguments --qase-mode=testops --qase-to-api-token=<> --qase-to-project=<> --qase-to-run=12

Using following:

qase-pytest==4.0.0
qaseio==3.0.0
Traceback (most recent call last):
  File "/Users/krishnayadav/Library/Application Support/JetBrains/PyCharm2022.1/plugins/evaluate-async-code/_pydevd_async_debug.py", line 627, in <module>
    run_path(sys.argv.pop(1), {}, "__main__")  # pragma: no cover
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 263, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2181, in <module>
    main()
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2172, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1484, in run
    return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1491, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/_jb_pytest_runner.py", line 51, in <module>
    sys.exit(pytest.main(args, plugins_to_load + [Plugin]))
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/_pytest/config/__init__.py", line 167, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/_pytest/main.py", line 317, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/_pytest/main.py", line 305, in wrap_session
    config.hook.pytest_sessionfinish(
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/_pytest/terminal.py", line 808, in pytest_sessionfinish
    outcome.get_result()
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/qaseio/pytest/plugin.py", line 99, in pytest_sessionfinish
    self.reporter.complete_run()
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/qaseio/pytest/testops.py", line 262, in complete_run
    self._complete_run()
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/qaseio/pytest/testops.py", line 113, in _complete_run
    res = api_runs.get_run(self.project_code, self.run_id).result
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/qaseio/api/runs_api.py", line 805, in get_run
    return self.get_run_endpoint.call_with_http_info(**kwargs)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/qaseio/api_client.py", line 859, in call_with_http_info
    self.__validate_inputs(kwargs)
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/qaseio/api_client.py", line 753, in __validate_inputs
    fixed_val = validate_and_convert_types(
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/qaseio/model_utils.py", line 1583, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/Users/krishnayadav/Krishna/repositorties/fastfood/venv38/lib/python3.8/site-packages/qaseio/model_utils.py", line 1458, in attempt_convert_item
    raise get_type_error(input_value, path_to_item, valid_classes,
qaseio.exceptions.ApiTypeError: Invalid type for variable 'id'. Required value type is int and passed type was str at ['id']

I believe this is fixed: d141634

but it is not available in 4.0.0 version

Thanks a lot. This is fixed