pytest: 6.2.4: pytest selftests fail in env with many plugins installed

I know that in pytest CI is used tox 😮) Nevertheless I’ve made the test testing pytest themes in env where I have many pytest extensions amongst +420 installed python modules which I’ve packaged by myself into rpm packages. I know as well that in such case not only warnings but many even errors could be false positive.

For now I was able to identify one group of warnings like below could be real issue. In this case I’m usimg latest subunit 1.4.0.

testing/test_unittest.py:419:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/twisted/trial/unittest.py:20: in <module>
    from twisted.trial._asyncrunner import TestSuite, TestDecorator, decorate
/usr/lib/python3.8/site-packages/twisted/trial/_asyncrunner.py:15: in <module>
    from twisted.trial import itrial, reporter
/usr/lib/python3.8/site-packages/twisted/trial/reporter.py:29: in <module>
    from subunit import TestProtocolClient
/usr/lib/python3.8/site-packages/subunit/__init__.py:142: in <module>
    from subunit.v2 import ByteStreamToStreamResult, StreamResultToBytes
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    import codecs
    utf_8_decode = codecs.utf_8_decode
    import datetime
    from io import UnsupportedOperation
    import os
    import select
    import struct
    import sys
    import zlib

    from extras import safe_hasattr, try_imports
    builtins = try_imports(['__builtin__', 'builtins'])

    import subunit
    import subunit.iso8601 as iso8601

    __all__ = [
        'ByteStreamToStreamResult',
        'StreamResultToBytes',
        ]

    SIGNATURE = b'\xb3'
    FMT_8  = '>B'
    FMT_16 = '>H'
    FMT_24 = '>HB'
    FMT_32 = '>I'
    FMT_TIMESTAMP = '>II'
    FLAG_TEST_ID = 0x0800
    FLAG_ROUTE_CODE = 0x0400
    FLAG_TIMESTAMP = 0x0200
    FLAG_RUNNABLE = 0x0100
    FLAG_TAGS = 0x0080
    FLAG_MIME_TYPE = 0x0020
    FLAG_EOF = 0x0010
    FLAG_FILE_CONTENT = 0x0040
>   EPOCH = datetime.datetime.utcfromtimestamp(0).replace(tzinfo=iso8601.Utc())
E   AttributeError: module 'subunit.iso8601' has no attribute 'Utc'

/usr/lib/python3.8/site-packages/subunit/v2.py:52: AttributeError
_____ ERROR at setup of TestTrialUnittest.test_trial_exceptions_with_skips _____

I would be glad if someone better skilled in python than I would have look on attached log.

  • a detailed description of the bug or problem you are having
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible

Full build log of build pytest rpm package. python-pytest.txt pip list pip_list.txt

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (5 by maintainers)

Most upvoted comments

this isn’t a problem with pytest – but with whatever broken plugin you have installed

May I ask to point on some issues which you spotted?

This is a problem with your setup of some sorts, not with pytest. I’m pretty sure you’ll see the same issue if you run python3.8 -c "twisted.trial.unittest".

Looks like this Fedora issue: https://bugzilla.redhat.com/show_bug.cgi?id=1811697