Skip to content

Logger test failures when pytest-qt is installed #7572

Closed

Description

@astrofrog

There is a pytest plugin called pytest-qt that is used by some packages - one of the side effect it has on all packages is to fail if there is any output printed to stderr during the test phase. There are a couple of failures in astropy that happen when pytest-qt is installed - this is more annoying than serious but it'd still be good to track down why these happen, and whether they can be safely ignored.

============================================================================== FAILURES ===============================================================================
_______________________________________________________________________ test_exception_logging ________________________________________________________________________
CALL ERROR: Qt exceptions in virtual methods:
________________________________________________________________________________
Traceback (most recent call last):
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/tests/test_logger.py", line 205, in test_exception_logging
    raise Exception("This is an Exception")
Exception: This is an Exception

________________________________________________________________________________
Traceback (most recent call last):
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/tests/test_logger.py", line 217, in test_exception_logging
    raise Exception("This is an Exception")
Exception: This is an Exception

________________________________________________________________________________
Traceback (most recent call last):
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/tests/test_logger.py", line 232, in test_exception_logging
    raise Exception("This is an Exception")
Exception: This is an Exception

________________________________________________________________________________

------------------------------------------------------------------------ Captured stderr call -------------------------------------------------------------------------
Qt exceptions in virtual methods:
________________________________________________________________________________
Traceback (most recent call last):
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/tests/test_logger.py", line 205, in test_exception_logging
    raise Exception("This is an Exception")
Exception: This is an Exception

________________________________________________________________________________
ERROR: Exception: This is an Exception [astropy.tests.test_logger]
Qt exceptions in virtual methods:
________________________________________________________________________________
Traceback (most recent call last):
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/tests/test_logger.py", line 217, in test_exception_logging
    raise Exception("This is an Exception")
Exception: This is an Exception

________________________________________________________________________________
Qt exceptions in virtual methods:
________________________________________________________________________________
Traceback (most recent call last):
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/tests/test_logger.py", line 232, in test_exception_logging
    raise Exception("This is an Exception")
Exception: This is an Exception

________________________________________________________________________________
-------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------
logger.py                  259 ERROR    Exception: This is an Exception
____________________________________________________________________ test_exception_logging_origin ____________________________________________________________________
CALL ERROR: Qt exceptions in virtual methods:
________________________________________________________________________________
Traceback (most recent call last):
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/tests/test_logger.py", line 252, in test_exception_logging_origin
    l.append('foo')
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/utils/collections.py", line 47, in append
    self._assert(x)
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/utils/collections.py", line 31, in _assert
    "type '{}'".format(self._types))
TypeError: homogeneous list must contain only objects of type '<class 'int'>'

________________________________________________________________________________

------------------------------------------------------------------------ Captured stderr call -------------------------------------------------------------------------
ERROR: TypeError: homogeneous list must contain only objects of type '<class 'int'>' [astropy.utils.collections]
Qt exceptions in virtual methods:
________________________________________________________________________________
Traceback (most recent call last):
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/tests/test_logger.py", line 252, in test_exception_logging_origin
    l.append('foo')
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/utils/collections.py", line 47, in append
    self._assert(x)
  File "/private/var/folders/zy/t1l3sx310d3d6p0kyxqzlrnr0000gr/T/astropy-test-1izlslk0/lib/python3.6/site-packages/astropy/utils/collections.py", line 31, in _assert
    "type '{}'".format(self._types))
TypeError: homogeneous list must contain only objects of type '<class 'int'>'

________________________________________________________________________________
-------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------
logger.py                  259 ERROR    TypeError: homogeneous list must contain only objects of type '<class 'int'>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions