pycairo icon indicating copy to clipboard operation
pycairo copied to clipboard

1.21.0: pytest is failing

Open kloczek opened this issue 3 years ago • 3 comments

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.21.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.21.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0
collected 0 items / 20 errors

================================================================================== ERRORS ==================================================================================
____________________________________________________________________ ERROR collecting tests/test_api.py ____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_api.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_api.py:16: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
___________________________________________________________________ ERROR collecting tests/test_cmod.py ____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_cmod.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_cmod.py:5: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
__________________________________________________________________ ERROR collecting tests/test_context.py __________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_context.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_context.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
__________________________________________________________________ ERROR collecting tests/test_device.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_device.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_device.py:7: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
___________________________________________________________________ ERROR collecting tests/test_enums.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_enums.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_enums.py:6: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
___________________________________________________________________ ERROR collecting tests/test_error.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_error.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_error.py:3: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
___________________________________________________________________ ERROR collecting tests/test_font.py ____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_font.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_font.py:3: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
___________________________________________________________________ ERROR collecting tests/test_glyph.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_glyph.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_glyph.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
________________________________________________________________ ERROR collecting tests/test_hypothesis.py _________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_hypothesis.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_hypothesis.py:11: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
__________________________________________________________________ ERROR collecting tests/test_matrix.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_matrix.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_matrix.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
___________________________________________________________________ ERROR collecting tests/test_path.py ____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_path.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_path.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
__________________________________________________________________ ERROR collecting tests/test_pattern.py __________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_pattern.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_pattern.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
_________________________________________________________________ ERROR collecting tests/test_rectangle.py _________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_rectangle.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_rectangle.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
__________________________________________________________________ ERROR collecting tests/test_region.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_region.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_region.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
__________________________________________________________________ ERROR collecting tests/test_surface.py __________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_surface.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_surface.py:12: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
_______________________________________________________________ ERROR collecting tests/test_surface_numpy.py _______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_surface_numpy.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_surface_numpy.py:6: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
______________________________________________________________ ERROR collecting tests/test_surface_pygame.py _______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_surface_pygame.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_surface_pygame.py:3: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
________________________________________________________________ ERROR collecting tests/test_textcluster.py ________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_textcluster.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_textcluster.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
________________________________________________________________ ERROR collecting tests/test_textextents.py ________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_textextents.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_textextents.py:1: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
__________________________________________________________________ ERROR collecting tests/test_typing.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_typing.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_typing.py:5: in <module>
    import cairo
cairo/__init__.py:1: in <module>
    from ._cairo import *  # noqa: F401,F403
E   ModuleNotFoundError: No module named 'cairo._cairo'
========================================================================= short test summary info ==========================================================================
ERROR tests/test_api.py
ERROR tests/test_cmod.py
ERROR tests/test_context.py
ERROR tests/test_device.py
ERROR tests/test_enums.py
ERROR tests/test_error.py
ERROR tests/test_font.py
ERROR tests/test_glyph.py
ERROR tests/test_hypothesis.py
ERROR tests/test_matrix.py
ERROR tests/test_path.py
ERROR tests/test_pattern.py
ERROR tests/test_rectangle.py
ERROR tests/test_region.py
ERROR tests/test_surface.py
ERROR tests/test_surface_numpy.py
ERROR tests/test_surface_pygame.py
ERROR tests/test_textcluster.py
ERROR tests/test_textextents.py
ERROR tests/test_typing.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 20 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================ 20 errors in 0.68s ============================================================================

kloczek avatar May 01 '22 17:05 kloczek

The same with --import-mode=importlib

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.21.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.21.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --import-mode=importlib
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0
collected 263 items / 1 error / 2 skipped

================================================================================== ERRORS ==================================================================================
___________________________________________________________________ ERROR collecting tests/test_cmod.py ____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/tests/test_cmod.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_cmod.py:7: in <module>
    from . import cmod
E   ImportError: cannot import name 'cmod' from 'tests' (unknown location)
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_hypothesis.py:13: could not import 'hypothesis': No module named 'hypothesis'
SKIPPED [1] tests/test_surface_pygame.py:6: could not import 'pygame': No module named 'pygame'
ERROR tests/test_cmod.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 2 skipped, 1 error in 0.65s ========================================================================

Issue is that there is no cmod module in tests/ (despite missing in this case hypothesis and pygame)

kloczek avatar May 01 '22 17:05 kloczek

I found that in fedora is used seyup.py test but even that is failing

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.21.0-2.fc35.x86_64//usr/lib64/python3.8/site-packages
+ /usr/bin/python3 setup.py test
running test
copying build/lib.linux-x86_64-3.8/cairo/_cairo.cpython-38-x86_64-linux-gnu.so -> cairo
building 'tests.cmod' extension
creating build/pycairo_tests
creating build/pycairo_tests/temp.linux-x86_64-3.8
creating build/pycairo_tests/temp.linux-x86_64-3.8/tests
creating build/pycairo_tests/temp.linux-x86_64-3.8/tests/cmodule
/usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fPIC -DPY_SSIZE_T_CLEAN -Itests/cmodule -Icairo -I/usr/include/cairo -I/usr/include/python3.8 -c tests/cmodule/cmodule.c -o build/pycairo_tests/temp.linux-x86_64-3.8/tests/cmodule/cmodule.o -Wall -Warray-bounds -Wcast-align -Wconversion -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Winline -Wmissing-format-attribute -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wundef -Wunused-but-set-variable -Wswitch-default -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-command-line-argument -fno-strict-aliasing -fvisibility=hidden -std=c99
/usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fPIC -DPY_SSIZE_T_CLEAN -Itests/cmodule -Icairo -I/usr/include/cairo -I/usr/include/python3.8 -c tests/cmodule/cmodulelib.c -o build/pycairo_tests/temp.linux-x86_64-3.8/tests/cmodule/cmodulelib.o -Wall -Warray-bounds -Wcast-align -Wconversion -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Winline -Wmissing-format-attribute -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wundef -Wunused-but-set-variable -Wswitch-default -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-command-line-argument -fno-strict-aliasing -fvisibility=hidden -std=c99
creating build/pycairo_tests/lib.linux-x86_64-3.8
creating build/pycairo_tests/lib.linux-x86_64-3.8/tests
/usr/bin/gcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 build/pycairo_tests/temp.linux-x86_64-3.8/tests/cmodule/cmodule.o build/pycairo_tests/temp.linux-x86_64-3.8/tests/cmodule/cmodulelib.o -L/usr/lib64 -lcairo -o build/pycairo_tests/lib.linux-x86_64-3.8/tests/cmod.cpython-38-x86_64-linux-gnu.so
copying build/pycairo_tests/lib.linux-x86_64-3.8/tests/cmod.cpython-38-x86_64-linux-gnu.so -> tests
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0
plugins: hypothesis-6.41.0
collected 275 items / 1 skipped

tests/test_api.py .................                                                                                                                                  [  6%]
tests/test_cmod.py .                                                                                                                                                 [  6%]
tests/test_context.py ...................................................................                                                                            [ 30%]
tests/test_device.py ...........                                                                                                                                     [ 34%]
tests/test_enums.py .......                                                                                                                                          [ 37%]
tests/test_error.py ....                                                                                                                                             [ 38%]
tests/test_font.py ..............................                                                                                                                    [ 49%]
tests/test_glyph.py ..                                                                                                                                               [ 50%]
tests/test_hypothesis.py ...........                                                                                                                                 [ 54%]
tests/test_matrix.py ...........                                                                                                                                     [ 58%]
tests/test_path.py ....                                                                                                                                              [ 60%]
tests/test_pattern.py ..............................                                                                                                                 [ 70%]
tests/test_rectangle.py ...                                                                                                                                          [ 72%]
tests/test_region.py ...........                                                                                                                                     [ 76%]
tests/test_surface.py ...................F........................................                                                                                   [ 97%]
tests/test_surface_numpy.py ..                                                                                                                                       [ 98%]
tests/test_textcluster.py .                                                                                                                                          [ 98%]
tests/test_textextents.py ..                                                                                                                                         [ 99%]
tests/test_typing.py .                                                                                                                                               [100%]

================================================================================= FAILURES =================================================================================
____________________________________________________________________ test_svg_surface_get_document_unit ____________________________________________________________________

    @pytest.mark.skipif(not hasattr(cairo.SVGSurface, "get_document_unit"),
                        reason="too old cairo")
    def test_svg_surface_get_document_unit():
        with cairo.SVGSurface(None, 10, 10) as surface:
>           assert surface.get_document_unit() == cairo.SVGUnit.PT
E           AssertionError: assert cairo.SVGUnit.USER == cairo.SVGUnit.PT
E            +  where cairo.SVGUnit.USER = <built-in method get_document_unit of cairo.SVGSurface object at 0x7f7ff6f21d50>()
E            +    where <built-in method get_document_unit of cairo.SVGSurface object at 0x7f7ff6f21d50> = <cairo.SVGSurface object at 0x7f7ff6f21d50>.get_document_unit
E            +  and   cairo.SVGUnit.PT = <class 'cairo.SVGUnit'>.PT
E            +    where <class 'cairo.SVGUnit'> = cairo.SVGUnit

tests/test_surface.py:270: AssertionError
========================================================================= short test summary info ==========================================================================
FAILED tests/test_surface.py::test_svg_surface_get_document_unit - AssertionError: assert cairo.SVGUnit.USER == cairo.SVGUnit.PT
================================================================= 1 failed, 274 passed, 1 skipped in 5.51s =================================================================

kloczek avatar May 01 '22 17:05 kloczek

Looks like on using meson test suite is failing in the same ubit

+ cd pycairo-1.21.0
+ /usr/bin/meson test -C x86_64-redhat-linux-gnu --num-processes 48 --print-errorlogs
ninja: Entering directory `/home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/x86_64-redhat-linux-gnu'
ninja: no work to do.
1/1 tests        FAIL            5.73s   exit status 1
>>> MALLOC_PERTURB_=153 /usr/bin/python3 -m pytest
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
============================= test session starts ==============================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0
plugins: hypothesis-6.41.0
collected 275 items / 1 skipped

tests/test_api.py .................                                      [  6%]
tests/test_cmod.py .                                                     [  6%]
tests/test_context.py .................................................. [ 24%]
.................                                                        [ 30%]
tests/test_device.py ...........                                         [ 34%]
tests/test_enums.py .......                                              [ 37%]
tests/test_error.py ....                                                 [ 38%]
tests/test_font.py ..............................                        [ 49%]
tests/test_glyph.py ..                                                   [ 50%]
tests/test_hypothesis.py ...........                                     [ 54%]
tests/test_matrix.py ...........                                         [ 58%]
tests/test_path.py ....                                                  [ 60%]
tests/test_pattern.py ..............................                     [ 70%]
tests/test_rectangle.py ...                                              [ 72%]
tests/test_region.py ...........                                         [ 76%]
tests/test_surface.py ...................F.............................. [ 94%]
..........                                                               [ 97%]
tests/test_surface_numpy.py ..                                           [ 98%]
tests/test_textcluster.py .                                              [ 98%]
tests/test_textextents.py ..                                             [ 99%]
tests/test_typing.py .                                                   [100%]

=================================== FAILURES ===================================
______________________ test_svg_surface_get_document_unit ______________________

    @pytest.mark.skipif(not hasattr(cairo.SVGSurface, "get_document_unit"),
                        reason="too old cairo")
    def test_svg_surface_get_document_unit():
        with cairo.SVGSurface(None, 10, 10) as surface:
>           assert surface.get_document_unit() == cairo.SVGUnit.PT
E           AssertionError: assert cairo.SVGUnit.USER == cairo.SVGUnit.PT
E            +  where cairo.SVGUnit.USER = <built-in method get_document_unit of cairo.SVGSurface object at 0x7f721b6ed9f0>()
E            +    where <built-in method get_document_unit of cairo.SVGSurface object at 0x7f721b6ed9f0> = <cairo.SVGSurface object at 0x7f721b6ed9f0>.get_document_unit
E            +  and   cairo.SVGUnit.PT = <class 'cairo.SVGUnit'>.PT
E            +    where <class 'cairo.SVGUnit'> = cairo.SVGUnit

tests/test_surface.py:270: AssertionError
=========================== short test summary info ============================
FAILED tests/test_surface.py::test_svg_surface_get_document_unit - AssertionE...
=================== 1 failed, 274 passed, 1 skipped in 5.43s ===================
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――


Summary of Failures:

1/1 tests FAIL            5.73s   exit status 1


Ok:                 0
Expected Fail:      0
Fail:               1
Unexpected Pass:    0
Skipped:            0
Timeout:            0

Full log written to /home/tkloczko/rpmbuild/BUILD/pycairo-1.21.0/x86_64-redhat-linux-gnu/meson-logs/testlog.txt

kloczek avatar May 01 '22 17:05 kloczek

In the latest release we have adjusted the test suite to work with cairo 1.17.6 and also the cmod test is now optional if you don't build it.

For the initial problem I'm not sure if/what we should do (??)

lazka avatar Nov 28 '22 19:11 lazka

For the initial problem I'm not sure if/what we should do (??)

ah, that part is just a duplicate of #258, so I'm closing this.

lazka avatar Nov 28 '22 20:11 lazka

Just tested 1.23.0 and meson test suite is OK however in meantime I've udated hypotesis to 6.58.1 abd looks like here is new issue. Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.23.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.23.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --import-mode=importlib
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0
plugins: hypothesis-6.58.1
collected 532 items / 2 errors / 4 skipped

================================================================================== ERRORS ==================================================================================
________________________________________________________________ ERROR collecting tests/test_hypothesis.py _________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_hypothesis.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_hypothesis.py:17: in <module>
    from .hypothesis_fspaths import fspaths
E   ModuleNotFoundError: No module named 'tests.hypothesis_fspaths'; 'tests' is not a package
____________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_hypothesis.py _____________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_hypothesis.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
x86_64-redhat-linux-gnu/tests/test_hypothesis.py:17: in <module>
    from .hypothesis_fspaths import fspaths
E   ModuleNotFoundError: No module named 'x86_64-redhat-linux-gnu.tests.hypothesis_fspaths'; 'x86_64-redhat-linux-gnu.tests' is not a package
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_cmod.py:11: cmod not built
SKIPPED [1] tests/test_surface_pygame.py:6: could not import 'pygame': No module named 'pygame'
SKIPPED [1] x86_64-redhat-linux-gnu/tests/test_cmod.py:11: cmod not built
SKIPPED [1] x86_64-redhat-linux-gnu/tests/test_surface_pygame.py:6: could not import 'pygame': No module named 'pygame'
ERROR tests/test_hypothesis.py
ERROR x86_64-redhat-linux-gnu/tests/test_hypothesis.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 4 skipped, 2 errors in 1.24s =======================================================================

kloczek avatar Nov 28 '22 21:11 kloczek

You forgot to use --import-mode append

lazka avatar Nov 29 '22 07:11 lazka

Just tested dftaht and it soes not worrk.

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.23.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/pycairo-1.23.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --import-mode=append
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0
plugins: asyncio-0.20.2, timeout-2.1.0, flaky-3.7.0, hypothesis-6.58.1
asyncio: mode=strict
collected 277 items / 18 errors / 4 skipped

================================================================================== ERRORS ==================================================================================
________________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_api.py ________________________________________________________
import file mismatch:
imported module 'tests.test_api' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_api.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_api.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_context.py ______________________________________________________
import file mismatch:
imported module 'tests.test_context' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_context.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_context.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_device.py _______________________________________________________
import file mismatch:
imported module 'tests.test_device' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_device.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_device.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_enums.py _______________________________________________________
import file mismatch:
imported module 'tests.test_enums' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_enums.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_enums.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_error.py _______________________________________________________
import file mismatch:
imported module 'tests.test_error' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_error.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_error.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_font.py ________________________________________________________
import file mismatch:
imported module 'tests.test_font' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_font.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_font.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_glyph.py _______________________________________________________
import file mismatch:
imported module 'tests.test_glyph' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_glyph.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_glyph.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_hypothesis.py _____________________________________________________
import file mismatch:
imported module 'tests.test_hypothesis' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_hypothesis.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_hypothesis.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_matrix.py _______________________________________________________
import file mismatch:
imported module 'tests.test_matrix' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_matrix.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_matrix.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_path.py ________________________________________________________
import file mismatch:
imported module 'tests.test_path' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_path.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_path.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_pattern.py ______________________________________________________
import file mismatch:
imported module 'tests.test_pattern' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_pattern.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_pattern.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_____________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_rectangle.py _____________________________________________________
import file mismatch:
imported module 'tests.test_rectangle' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_rectangle.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_rectangle.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_region.py _______________________________________________________
import file mismatch:
imported module 'tests.test_region' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_region.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_region.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_surface.py ______________________________________________________
import file mismatch:
imported module 'tests.test_surface' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_surface.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_surface.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
___________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_surface_numpy.py ___________________________________________________
import file mismatch:
imported module 'tests.test_surface_numpy' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_surface_numpy.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_surface_numpy.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_textcluster.py ____________________________________________________
import file mismatch:
imported module 'tests.test_textcluster' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_textcluster.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_textcluster.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_textextents.py ____________________________________________________
import file mismatch:
imported module 'tests.test_textextents' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_textextents.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_textextents.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________________________________________ ERROR collecting x86_64-redhat-linux-gnu/tests/test_typing.py _______________________________________________________
import file mismatch:
imported module 'tests.test_typing' has this __file__ attribute:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/tests/test_typing.py
which is not the same as the test file we want to collect:
  /home/tkloczko/rpmbuild/BUILD/pycairo-1.23.0/x86_64-redhat-linux-gnu/tests/test_typing.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
========================================================================= short test summary info ==========================================================================
SKIPPED [2] tests/test_cmod.py:11: cmod not built
SKIPPED [2] tests/test_surface_pygame.py:6: could not import 'pygame': No module named 'pygame'
ERROR x86_64-redhat-linux-gnu/tests/test_api.py
ERROR x86_64-redhat-linux-gnu/tests/test_context.py
ERROR x86_64-redhat-linux-gnu/tests/test_device.py
ERROR x86_64-redhat-linux-gnu/tests/test_enums.py
ERROR x86_64-redhat-linux-gnu/tests/test_error.py
ERROR x86_64-redhat-linux-gnu/tests/test_font.py
ERROR x86_64-redhat-linux-gnu/tests/test_glyph.py
ERROR x86_64-redhat-linux-gnu/tests/test_hypothesis.py
ERROR x86_64-redhat-linux-gnu/tests/test_matrix.py
ERROR x86_64-redhat-linux-gnu/tests/test_path.py
ERROR x86_64-redhat-linux-gnu/tests/test_pattern.py
ERROR x86_64-redhat-linux-gnu/tests/test_rectangle.py
ERROR x86_64-redhat-linux-gnu/tests/test_region.py
ERROR x86_64-redhat-linux-gnu/tests/test_surface.py
ERROR x86_64-redhat-linux-gnu/tests/test_surface_numpy.py
ERROR x86_64-redhat-linux-gnu/tests/test_textcluster.py
ERROR x86_64-redhat-linux-gnu/tests/test_textextents.py
ERROR x86_64-redhat-linux-gnu/tests/test_typing.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 18 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================================== 4 skipped, 18 errors in 1.22s =======================================================================

Looking only on the output probably some relative imports are used.

kloczek avatar Nov 29 '22 09:11 kloczek