Code Monkey home page Code Monkey logo

Comments (5)

heibanke avatar heibanke commented on May 28, 2024

i got the same error.

from pytest-parallel.

blueyed avatar blueyed commented on May 28, 2024

It works with 5.2.4.dev6+ge856638ba for me (master), but fails on the "features" branch:

  File "…/Vcs/pytest/src/_pytest/terminal.py", line 468, in pytest_runtest_logfinish
    main_color, _ = _get_main_color(self.stats)
  File "…/Vcs/pytest/src/_pytest/terminal.py", line 1102, in _get_main_color
    for found_type in stats:
  File "<string>", line 2, in __iter__
  File "/usr/lib/python3.7/multiprocessing/managers.py", line 825, in _callmethod
    proxytype = self._manager._registry[token.typeid][-1]
AttributeError: 'NoneType' object has no attribute '_registry'

The following patch for pytest fixes it:

diff --git i/src/_pytest/terminal.py w/src/_pytest/terminal.py
index 40e12e406..e88545eca 100644
--- i/src/_pytest/terminal.py
+++ w/src/_pytest/terminal.py
@@ -1099,7 +1099,7 @@ def _get_main_color(stats) -> Tuple[str, List[str]]:
         "failed passed skipped deselected xfailed xpassed warnings error".split()
     )
     unknown_type_seen = False
-    for found_type in stats:
+    for found_type in stats.keys():
         if found_type not in known_types:
             if found_type:  # setup/teardown reports have an empty key, ignore them
                 known_types.append(found_type)

I have some WIP in that area already, but pytest-parallel should handle iteration of stats probably, if it's easy.

Related code there: https://github.com/browsertron/pytest-parallel/blob/eb851777d354ba79d26d9b088bc1c22a8d44720b/pytest_parallel/__init__.py#L254-L269
(haven't looked at it really)

from pytest-parallel.

blueyed avatar blueyed commented on May 28, 2024

JFI: the error I've posted happens when run in the subprocess, and starts to happen with pytest 5.3.0.

I am not sure why the original report is a problem / how it is triggered, since this should run in the main process.

pytest-dev/pytest#6261 however should fix both (at least the one from me).

from pytest-parallel.

blueyed avatar blueyed commented on May 28, 2024

@AndyFoolish
Is this fixed with the latest release for you?

from pytest-parallel.

HardNorth avatar HardNorth commented on May 28, 2024

@azmeuk Please consider closing this out. It is seen by the discussion that the issue is related to pytest itself. And I also tested on my synthetic suite all major pytest versions starting from 5.2 till 7.1 without any issues. I would closed this until someone provide a reproducible example.

from pytest-parallel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.