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

[Question]: Tests don't run by command, but it runs by commands with parameters #1946

Closed
Mikhail94 opened this issue May 31, 2023 · 4 comments
Labels

Comments

@Mikhail94
Copy link

Your question

i have a project that connected to the qase.io
If I run tests by command with api-token as parameter then tests run successfully (example: pytest --qase-to-api-token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --qase-mode=testops --qase-to-project=TAP
--qase-to-plan=1 --qase-to-run-title="SalesMsg TestRun")
But if I run test by "pytest -s" command I have errors in terminal:
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\main.py", line 265, in wrap_session
INTERNALERROR> config.do_configure()
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\config_init
.py", line 1046, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_hooks.py", line 277, in call_historic
INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\pytest\conftest.py", line 109, in pytest_configure
INTERNALERROR> reporter = QaseTestOps(
INTERNALERROR> ^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\commons\testops.py", line 74, in init
INTERNALERROR> self._get_project(self.project_code)
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\commons\testops.py", line 80, in _get_project
INTERNALERROR> response = api_instance.get_project(code=project)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\api\projects_api.py", line 648, in get_project
INTERNALERROR> return self.get_project_endpoint.call_with_http_info(**kwargs)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\api_client.py", line 882, in call_with_http_info
INTERNALERROR> return self.api_client.call_api(
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\api_client.py", line 424, in call_api
INTERNALERROR> return self.__call_api(resource_path, method,
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> response_data = self.request(
INTERNALERROR> ^^^^^^^^^^^^^
INTERNALERROR> return self.rest_client.GET(url,
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\rest.py", line 236, in GET
INTERNALERROR> return self.request("GET", url,
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\rest.py", line 219, in request
INTERNALERROR> raise UnauthorizedException(http_resp=r)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\exceptions.py", line 136, in init
INTERNALERROR> super(UnauthorizedException, self).init(status, reason, http_resp)
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\exceptions.py", line 106, in init
INTERNALERROR> self.headers = http_resp.getheaders()
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "C:\Users\Nekl0\AppData\Local\Programs\Python\Python311\Lib\site-packages\qaseio\rest.py", line 39, in getheaders
INTERNALERROR> return self.urllib3_response.headers.get()
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> TypeError: Mapping.get() missing 1 required positional argument: 'key'

What is the reason can be?

@Mikhail94 Mikhail94 changed the title [Question]: [Question]: Tests don't run by command, but it runs by commands with parameters May 31, 2023
@mxschmitt
Copy link
Member

Have you tried the latest 7.3.1?

https://pypi.org/project/pytest/

Looks related to pytest-dev/pytest#9610

@Mikhail94
Copy link
Author

yes I have the latest version pytest 7.3.1

@mxschmitt
Copy link
Member

It looks more related to an issue inside qaseio rather than a Playwright issue. If you look at the stack trace from the error, you'll only see qaseio mentioned there a few times. Since Playwright does not depend on qaseio, I think you have it somewhere in your dependency tree.

@Mikhail94
Copy link
Author

I found how I can fix it

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

No branches or pull requests

2 participants