Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Latest pytest (7.2.0) breaks pytest-parallel. #118

Open
huntzhan opened this issue Oct 25, 2022 · 8 comments
Open

Latest pytest (7.2.0) breaks pytest-parallel. #118

huntzhan opened this issue Oct 25, 2022 · 8 comments

Comments

@huntzhan
Copy link

pytest just release a new version (7.1.3 -> 7.2.0) that breaks pytest-parallel. Error log:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/opt/_internal/cpython-3.9.15/lib/python3.9/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/opt/_internal/cpython-3.9.15/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/opt/_internal/cpython-3.9.15/lib/python3.9/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/opt/_internal/cpython-3.9.15/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/opt/_internal/cpython-3.9.15/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/opt/_internal/cpython-3.9.15/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/opt/_internal/cpython-3.9.15/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/opt/_internal/cpython-3.9.15/lib/python3.9/site-packages/pytest_parallel/__init__.py", line [11](https://github.com/vkit-x/vkit/actions/runs/3319272786/jobs/5484223267#step:8:12)1, in pytest_configure
INTERNALERROR>     config.pluginmanager.register(ParallelRunner(config), 'parallelrunner')
INTERNALERROR>   File "/opt/_internal/cpython-3.9.[15](https://github.com/vkit-x/vkit/actions/runs/3319272786/jobs/5484223267#step:8:16)/lib/python3.9/site-packages/pytest_parallel/__init__.py", line [19](https://github.com/vkit-x/vkit/actions/runs/3319272786/jobs/5484223267#step:8:20)6, in __init__
INTERNALERROR>     self._log = py.log.Producer('pytest-parallel')
INTERNALERROR> AttributeError: module 'py' has no attribute 'log'
@The-Compiler
Copy link

See pytest-dev/pytest#10420 (comment) for a similar issue. If pytest-parallel needs things in pylib outside of py.path, it should declare py as a dependency properly, which it currently does not.

@huntzhan
Copy link
Author

got it, thx

@The-Compiler
Copy link

@huntzhan Huh? This is a bug in pytest-parallel, so this shouldn't be closed until it's fixed here.

@huntzhan
Copy link
Author

huntzhan commented Oct 25, 2022

@huntzhan Huh? This is a bug in pytest-parallel, so this shouldn't be closed until it's fixed here.

Oh, I thought there's another issue to track the similar issue. Reopen again.

@huntzhan huntzhan reopened this Oct 25, 2022
@The-Compiler
Copy link

Note the immediate fix for this is for pytest-parallel to add the missing py dependency. As a workaround, you can install py yourself and things should start working.

In the long run, however, pytest-parallel should stop depending on pylib entirely, since we (pytest/pylib maintainers) want to sunset it. It's only used for logging. I'm not too familiar with py.log, but the Python stdlib logging might be a suitable replacement?

@huntzhan
Copy link
Author

@The-Compiler Thanks for your instruction!

kevlened pushed a commit that referenced this issue Oct 27, 2022
@kevlened
Copy link
Owner

Please see #119 (comment)

Unfortunately, I recommend version pinning to pytest 7.1.3 while planning a move to pytest-xdist

@The-Compiler
Copy link

No need to pin, just add py to your dependencies manually.

alexmojaki added a commit to alexmojaki/pyodide-worker-runner that referenced this issue Nov 11, 2022
roxell added a commit to roxell/lava-test-plans that referenced this issue Dec 2, 2022
From this link [1] it looks like installing 'py' will solve the issue.

Link: kevlened/pytest-parallel#118
Signed-off-by: Anders Roxell <[email protected]>
roxell added a commit to Linaro/lava-test-plans that referenced this issue Dec 2, 2022
From this link [1] it looks like installing 'py' will solve the issue.

Link: kevlened/pytest-parallel#118
Signed-off-by: Anders Roxell <[email protected]>
alexmojaki added a commit to alexmojaki/pyodide-worker-runner that referenced this issue Dec 31, 2022
mnot added a commit to mnot/thor that referenced this issue Jan 3, 2023
kelly-sovacool added a commit to SchlossLab/mikropml-snakemake-workflow that referenced this issue Jan 30, 2023
Got a warning in pytest-parallel, found out it's no longer maintained.
kevlened/pytest-parallel#118
ilyazub added a commit to serpapi/google-search-results-python that referenced this issue Feb 2, 2023
Sample output:

  platform linux -- Python 3.10.9, pytest-7.2.1, pluggy-1.0.0
  rootdir: /home/ilyazub/Workspace/google-search-results-python
  plugins: parallel-0.1.1
  collected 48

  pytest-parallel: 8 workers (processes), 6 tests per worker (threads)

`py` dependency is used because pytest-parallel depends on it but
doesn't require 😕
kevlened/pytest-parallel#118

Co-authored-by: Dimitry <[email protected]>
jvmvik pushed a commit to serpapi/google-search-results-python that referenced this issue May 1, 2023
…client (#30)

* Use pagination parameters from SerpApi instead of calculating on the client

`start` and `num` parameters are not suitable for token-based
pagination. Such pagination is used on Google Maps, YouTube, Google
Scholar Authors, and other search engines.

This commit consumes URL query parameters for the next page. It stops
paginating when parameters not change.

Details: #22

Some tests are failing because `start` and `num` parameters are not supported
anymore. These tests will be fixed in the following commits.

* Add pagination tests for Bing, Baidu, and DuckDuckGo search API clients

* Fix typo in SerpApi name in documentation

* Add more pagination tests

All of the tests follow the same pattern. Limit number of pages,
iterate, and check for duplicates in the results. This is to make sure
that pagination actually changes pages.

* Test pagination for Naver and HomeDepot

* Stop pagination when SerpApi backend doesn't update parameters

* Fix flake8 linting errors

Example errors: https://github.com/serpapi/google-search-results-python/runs/6659757610?check_suite_focus=true#step:5:37

* Lint code via `make lint`

Currently linting script exists only in GitHub Action: `.github/workflows/python-package.yml`.

This commit wraps that script in Makefile and invokes in an Action.

* fix(tests): fix failing integration tests

DuckDuckGo tests are failing because DuckDuckGo pagination doesn't take
into account an offset of current results:
serpapi/public-roadmap#619

Co-authored-by: Dimitry <[email protected]>

* perf: run pytest in parallel

Sample output:

  platform linux -- Python 3.10.9, pytest-7.2.1, pluggy-1.0.0
  rootdir: /home/ilyazub/Workspace/google-search-results-python
  plugins: parallel-0.1.1
  collected 48

  pytest-parallel: 8 workers (processes), 6 tests per worker (threads)

`py` dependency is used because pytest-parallel depends on it but
doesn't require 😕
kevlened/pytest-parallel#118

Co-authored-by: Dimitry <[email protected]>

* style: don't lint vendor packages with Flake8

Co-authored-by: Dimitry <[email protected]>

* docs: fix minor typos in documentation

Co-authored-by: Dimitry <[email protected]>

* ci: cache pip dependencies

Support Python 3.7+ based on the readme:
https://github.com/serpapi/google-search-results-python/blob/35e51c94e7243c29650ed7b630db4e4e6d0c61aa/README.md#L18

Co-authored-by: "dimitryzub <[email protected]>"

---------

Co-authored-by: Dimitry <[email protected]>
Co-authored-by: Dimitry <[email protected]>
simon-ritchie added a commit to simon-ritchie/apysc that referenced this issue Jul 5, 2023
ioggstream added a commit to ioggstream/daf-ontologie-vocabolari-controllati that referenced this issue Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants