AttributeError: module 'subunit' has no attribute 'test_results'. Did you mean: 'testresult'?

Bug #2045766 reported by Dmytro Kazantsev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-testr
Fix Released
Undecided
Takashi Kajinami

Bug Description

I run tox to install dependencies and run tests but it fails with following error:

File "/home/<XXX>/.tox/py310/lib/python3.10/site-packages/os_testr/subunit_trace.py", line 367, in trace
    cat = subunit.test_results.CatFiles(stdout)
AttributeError: module 'subunit' has no attribute 'test_results'. Did you mean: 'testresult'?

I can correct it locally by adding following to subunit_trace:

from subunit import test_results

367 cat = test_results.CatFiles(stdout)

Can you do the needful?

Python: Python 3.10.12

Revision history for this message
Takashi Kajinami (kajinamit) wrote (last edit ):

It seems the issue is caused by the change made in subunit 1.4.3 release.

https://github.com/testing-cabal/subunit/commit/6ded8d323f4b298fc1e44f134d240059fd00b4b5

Changed in os-testr:
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-testr (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/os-testr/+/904125

Changed in os-testr:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-testr (master)

Reviewed: https://review.opendev.org/c/openstack/os-testr/+/904125
Committed: https://opendev.org/openstack/os-testr/commit/a4876f6d6daf53fe0438f6151b697957ae2024d7
Submitter: "Zuul (22348)"
Branch: master

commit a4876f6d6daf53fe0438f6151b697957ae2024d7
Author: Takashi Kajinami <email address hidden>
Date: Wed Dec 20 22:59:43 2023 +0900

    Fix compatibility with subunit >= 1.4.3

    The subunit.test_results module is no longer imported by the top-level
    subunit module and we have to explicitly import it.

    This also fixes the broken doc build caused by the history.rst file.
    The change log is now maintained differently so we don't need it
    any more.

    Closes-Bug: #2045766
    Change-Id: Iae1ae0c55b8e1660a2bb41379a1f8f8506679cca

Changed in os-testr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.