question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'NoneType' object has no attribute '_registry' with pytest 5.3.0

See original GitHub issue

Hi there,

I run pytest with pytest-parallel (v 0.0.9) in a Gitlab CI-Pipeline. Without changing my code the pipeline jobs stopped working. The only thing that change was the pytest version from 5.2.4 to 5.3.0.

Also the pipeline job doesn’t seem to stop. It’s stuck in the status running until I cancel it.

The failed command is: - python setup.py install && pytest --workers 4 where setup.py install is our project specific setup script.

The hopefully relevant output:

============================= test session starts ==============================
platform linux -- Python 3.7.5, pytest-5.3.0, py-1.8.0, pluggy-0.13.0
rootdir: /builds/fsd/odx-ninja
plugins: parallel-0.0.9
collected 70 items
pytest-parallel: 4 workers (processes), 1 test per worker (thread)
....Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/site-packages/pytest_parallel/__init__.py", line 81, in run
    run_test(self.session, item, None)
  File "/usr/local/lib/python3.7/site-packages/pytest_parallel/__init__.py", line 51, in run_test
    item.ihook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python3.7/site-packages/_pytest/runner.py", line 82, in pytest_runtest_protocol
    item.ihook.pytest_runtest_logfinish(nodeid=item.nodeid, location=item.location)
  File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python3.7/site-packages/_pytest/terminal.py", line 468, in pytest_runtest_logfinish
    main_color, _ = _get_main_color(self.stats)
  File "/usr/local/lib/python3.7/site-packages/_pytest/terminal.py", line 1102, in _get_main_color
    for found_type in stats:
  File "<string>", line 2, in __iter__
  File "/usr/local/lib/python3.7/multiprocessing/managers.py", line 825, in _callmethod
    proxytype = self._manager._registry[token.typeid][-1]
AttributeError: 'NoneType' object has no attribute '_registry'

When the --workers 4 was removed the CI pipeline didn’t fail.

To avoid this we now fixed the pytest version to 5.2.4.

I also created an issue at pytest: https://github.com/pytest-dev/pytest/issues/6254

I hope I could help.

Best regards

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JuleBertcommented, Nov 25, 2019

Hi there, with pytest-parallel version 0.0.10 it now works.

Thanks a lot!

1reaction
kevlenedcommented, Nov 22, 2019

Thanks @blueyed! I’ll go through them this afternoon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'NoneType' object has no attribute '_registry' with pytest 5.3.0 ...
Hi there, I run pytest with pytest-parallel (v 0.0.9) in a Gitlab CI-Pipeline. Without changing my code the pipeline jobs stopped working.
Read more >
'NoneType' object has no attribute 'get' using Pytest - Stack ...
where test_login the python main file getting the Attribute error. The below code is for test_login: from self import self from pageObjects.
Read more >
Why do I get AttributeError: 'NoneType' object has no attribute ...
1 Answer ... You are getting AttributeError: 'NoneType' object has no attribute 'something' because NoneType means that instead of an instance of whatever...
Read more >
NoneType object has no attribute text | Edureka Community
AttributeError : 'NoneType' object has no attribute 'foo' - This usually happens because you called find() and then tried to access the .foo ......
Read more >
Ticket: User Preferences throws AttributeError: 'NoneType ...
@pytest.mark.user_preferences def test_empty_prefs_are_valid(client): ... E AttributeError: 'NoneType' object has no attribute 'get'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found