Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3.1: pytest is failing #273

Closed
kloczek opened this issue Nov 29, 2022 · 2 comments
Closed

2.3.1: pytest is failing #273

kloczek opened this issue Nov 29, 2022 · 2 comments
Labels
type: bug 🪲 Something is wrong

Comments

@kloczek
Copy link

kloczek commented Nov 29, 2022

Brief description
Pytest is failing in few units

Expected behavior
pytest should not fail.

Actual behavior

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.3.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.3.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --deselect README.rst::README.rst --deselect tests/test_readme.py::test_readme_shell_cmds
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/sphobjinv-2.3.1, configfile: tox.ini
plugins: pytest_check-1.0.5
collected 759 items / 1 deselected / 758 selected

tests/test_api_fail.py ................................xxxx                                                                                                          [  4%]
tests/test_api_good.py ...............................FFFFFFFF.......................................................................s.sssssssssssssssssssssssssssss [ 23%]
sssssssssssssssssssssssssssssss.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.                                                                         [ 35%]
tests/test_api_good_nonlocal.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss                                                                      [ 43%]
tests/test_cli.py ......s...s...s.........s.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.....................F.......                                 [ 58%]
tests/test_cli_nonlocal.py ssssssssssss                                                                                                                              [ 60%]
tests/test_fixture.py .F...                                                                                                                                          [ 61%]
tests/test_flake8_ext.py s                                                                                                                                           [ 61%]
tests/test_intersphinx.py ....                                                                                                                                       [ 61%]
tests/test_valid_objects.py .............................................x........................x................................................................. [ 79%]
..........................................................................................................................................................           [100%]

================================================================================= FAILURES =================================================================================
_______________________________________________ TestInventory.test_api_inventory_bytes_fname_instantiation[no_op--plaintext] _______________________________________________

self = <tests.test_api_good.TestInventory object at 0x7fc9ec371d00>, source_type = <SourceTypes.BytesPlaintext: 'bytes_plain'>, inv_arg = 'plaintext'
path_fxn = <function no_op at 0x7fcb70c37160>, res_path = PosixPath('tests/resource'), misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>
attrs_inventory_test = <function attrs_inventory_test.<locals>.func at 0x7fc9ebf8d3a0>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.parametrize(
        ["source_type", "inv_arg"],
        [
            (soi.SourceTypes.BytesPlaintext, "plaintext"),
            (soi.SourceTypes.BytesZlib, "zlib"),
            (soi.SourceTypes.FnamePlaintext, "fname_plain"),
            (soi.SourceTypes.FnameZlib, "fname_zlib"),
        ],
        ids=(lambda v: v if isinstance(v, str) else ""),
    )
    @pytest.mark.parametrize("path_fxn", PATH_FXNS, ids=PATH_FXN_IDS)
    def test_api_inventory_bytes_fname_instantiation(
        self,
        source_type,
        inv_arg,
        path_fxn,
        res_path,
        misc_info,
        attrs_inventory_test,
        check,
    ):
        """Check bytes and filename modes for Inventory instantiation."""
        fname = misc_info.FNames.RES

        if source_type in (
            soi.SourceTypes.BytesPlaintext,
            soi.SourceTypes.FnamePlaintext,
        ):
            fname += misc_info.Extensions.DEC
        else:
            fname += misc_info.Extensions.CMP

        source = path_fxn(res_path / fname)

        if source_type in (soi.SourceTypes.BytesPlaintext, soi.SourceTypes.BytesZlib):
            # Passing in the actual inventory contents, and not just the location
            source = soi.readbytes(source)

        # General import, without a specified kwarg
>       with check(msg="general"):
E       TypeError: 'module' object is not callable

tests/test_api_good.py:369: TypeError
_________________________________________________ TestInventory.test_api_inventory_bytes_fname_instantiation[no_op--zlib] __________________________________________________

self = <tests.test_api_good.TestInventory object at 0x7fc9ec371dc0>, source_type = <SourceTypes.BytesZlib: 'bytes_zlib'>, inv_arg = 'zlib'
path_fxn = <function no_op at 0x7fcb70c37160>, res_path = PosixPath('tests/resource'), misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>
attrs_inventory_test = <function attrs_inventory_test.<locals>.func at 0x7fc9ebf8d3a0>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.parametrize(
        ["source_type", "inv_arg"],
        [
            (soi.SourceTypes.BytesPlaintext, "plaintext"),
            (soi.SourceTypes.BytesZlib, "zlib"),
            (soi.SourceTypes.FnamePlaintext, "fname_plain"),
            (soi.SourceTypes.FnameZlib, "fname_zlib"),
        ],
        ids=(lambda v: v if isinstance(v, str) else ""),
    )
    @pytest.mark.parametrize("path_fxn", PATH_FXNS, ids=PATH_FXN_IDS)
    def test_api_inventory_bytes_fname_instantiation(
        self,
        source_type,
        inv_arg,
        path_fxn,
        res_path,
        misc_info,
        attrs_inventory_test,
        check,
    ):
        """Check bytes and filename modes for Inventory instantiation."""
        fname = misc_info.FNames.RES

        if source_type in (
            soi.SourceTypes.BytesPlaintext,
            soi.SourceTypes.FnamePlaintext,
        ):
            fname += misc_info.Extensions.DEC
        else:
            fname += misc_info.Extensions.CMP

        source = path_fxn(res_path / fname)

        if source_type in (soi.SourceTypes.BytesPlaintext, soi.SourceTypes.BytesZlib):
            # Passing in the actual inventory contents, and not just the location
            source = soi.readbytes(source)

        # General import, without a specified kwarg
>       with check(msg="general"):
E       TypeError: 'module' object is not callable

tests/test_api_good.py:369: TypeError
______________________________________________ TestInventory.test_api_inventory_bytes_fname_instantiation[no_op--fname_plain] ______________________________________________

self = <tests.test_api_good.TestInventory object at 0x7fc9ec371e80>, source_type = <SourceTypes.FnamePlaintext: 'fname_plain'>, inv_arg = 'fname_plain'
path_fxn = <function no_op at 0x7fcb70c37160>, res_path = PosixPath('tests/resource'), misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>
attrs_inventory_test = <function attrs_inventory_test.<locals>.func at 0x7fc9ebf8d3a0>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.parametrize(
        ["source_type", "inv_arg"],
        [
            (soi.SourceTypes.BytesPlaintext, "plaintext"),
            (soi.SourceTypes.BytesZlib, "zlib"),
            (soi.SourceTypes.FnamePlaintext, "fname_plain"),
            (soi.SourceTypes.FnameZlib, "fname_zlib"),
        ],
        ids=(lambda v: v if isinstance(v, str) else ""),
    )
    @pytest.mark.parametrize("path_fxn", PATH_FXNS, ids=PATH_FXN_IDS)
    def test_api_inventory_bytes_fname_instantiation(
        self,
        source_type,
        inv_arg,
        path_fxn,
        res_path,
        misc_info,
        attrs_inventory_test,
        check,
    ):
        """Check bytes and filename modes for Inventory instantiation."""
        fname = misc_info.FNames.RES

        if source_type in (
            soi.SourceTypes.BytesPlaintext,
            soi.SourceTypes.FnamePlaintext,
        ):
            fname += misc_info.Extensions.DEC
        else:
            fname += misc_info.Extensions.CMP

        source = path_fxn(res_path / fname)

        if source_type in (soi.SourceTypes.BytesPlaintext, soi.SourceTypes.BytesZlib):
            # Passing in the actual inventory contents, and not just the location
            source = soi.readbytes(source)

        # General import, without a specified kwarg
>       with check(msg="general"):
E       TypeError: 'module' object is not callable

tests/test_api_good.py:369: TypeError
______________________________________________ TestInventory.test_api_inventory_bytes_fname_instantiation[no_op--fname_zlib] _______________________________________________

self = <tests.test_api_good.TestInventory object at 0x7fc9ec371f40>, source_type = <SourceTypes.FnameZlib: 'fname_zlib'>, inv_arg = 'fname_zlib'
path_fxn = <function no_op at 0x7fcb70c37160>, res_path = PosixPath('tests/resource'), misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>
attrs_inventory_test = <function attrs_inventory_test.<locals>.func at 0x7fc9ebf8d3a0>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.parametrize(
        ["source_type", "inv_arg"],
        [
            (soi.SourceTypes.BytesPlaintext, "plaintext"),
            (soi.SourceTypes.BytesZlib, "zlib"),
            (soi.SourceTypes.FnamePlaintext, "fname_plain"),
            (soi.SourceTypes.FnameZlib, "fname_zlib"),
        ],
        ids=(lambda v: v if isinstance(v, str) else ""),
    )
    @pytest.mark.parametrize("path_fxn", PATH_FXNS, ids=PATH_FXN_IDS)
    def test_api_inventory_bytes_fname_instantiation(
        self,
        source_type,
        inv_arg,
        path_fxn,
        res_path,
        misc_info,
        attrs_inventory_test,
        check,
    ):
        """Check bytes and filename modes for Inventory instantiation."""
        fname = misc_info.FNames.RES

        if source_type in (
            soi.SourceTypes.BytesPlaintext,
            soi.SourceTypes.FnamePlaintext,
        ):
            fname += misc_info.Extensions.DEC
        else:
            fname += misc_info.Extensions.CMP

        source = path_fxn(res_path / fname)

        if source_type in (soi.SourceTypes.BytesPlaintext, soi.SourceTypes.BytesZlib):
            # Passing in the actual inventory contents, and not just the location
            source = soi.readbytes(source)

        # General import, without a specified kwarg
>       with check(msg="general"):
E       TypeError: 'module' object is not callable

tests/test_api_good.py:369: TypeError
________________________________________________ TestInventory.test_api_inventory_bytes_fname_instantiation[str--plaintext] ________________________________________________

self = <tests.test_api_good.TestInventory object at 0x7fc9ec37d040>, source_type = <SourceTypes.BytesPlaintext: 'bytes_plain'>, inv_arg = 'plaintext'
path_fxn = <class 'str'>, res_path = PosixPath('tests/resource'), misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>
attrs_inventory_test = <function attrs_inventory_test.<locals>.func at 0x7fc9ebf8d3a0>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.parametrize(
        ["source_type", "inv_arg"],
        [
            (soi.SourceTypes.BytesPlaintext, "plaintext"),
            (soi.SourceTypes.BytesZlib, "zlib"),
            (soi.SourceTypes.FnamePlaintext, "fname_plain"),
            (soi.SourceTypes.FnameZlib, "fname_zlib"),
        ],
        ids=(lambda v: v if isinstance(v, str) else ""),
    )
    @pytest.mark.parametrize("path_fxn", PATH_FXNS, ids=PATH_FXN_IDS)
    def test_api_inventory_bytes_fname_instantiation(
        self,
        source_type,
        inv_arg,
        path_fxn,
        res_path,
        misc_info,
        attrs_inventory_test,
        check,
    ):
        """Check bytes and filename modes for Inventory instantiation."""
        fname = misc_info.FNames.RES

        if source_type in (
            soi.SourceTypes.BytesPlaintext,
            soi.SourceTypes.FnamePlaintext,
        ):
            fname += misc_info.Extensions.DEC
        else:
            fname += misc_info.Extensions.CMP

        source = path_fxn(res_path / fname)

        if source_type in (soi.SourceTypes.BytesPlaintext, soi.SourceTypes.BytesZlib):
            # Passing in the actual inventory contents, and not just the location
            source = soi.readbytes(source)

        # General import, without a specified kwarg
>       with check(msg="general"):
E       TypeError: 'module' object is not callable

tests/test_api_good.py:369: TypeError
__________________________________________________ TestInventory.test_api_inventory_bytes_fname_instantiation[str--zlib] ___________________________________________________

self = <tests.test_api_good.TestInventory object at 0x7fc9ec37d100>, source_type = <SourceTypes.BytesZlib: 'bytes_zlib'>, inv_arg = 'zlib', path_fxn = <class 'str'>
res_path = PosixPath('tests/resource'), misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>
attrs_inventory_test = <function attrs_inventory_test.<locals>.func at 0x7fc9ebf8d3a0>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.parametrize(
        ["source_type", "inv_arg"],
        [
            (soi.SourceTypes.BytesPlaintext, "plaintext"),
            (soi.SourceTypes.BytesZlib, "zlib"),
            (soi.SourceTypes.FnamePlaintext, "fname_plain"),
            (soi.SourceTypes.FnameZlib, "fname_zlib"),
        ],
        ids=(lambda v: v if isinstance(v, str) else ""),
    )
    @pytest.mark.parametrize("path_fxn", PATH_FXNS, ids=PATH_FXN_IDS)
    def test_api_inventory_bytes_fname_instantiation(
        self,
        source_type,
        inv_arg,
        path_fxn,
        res_path,
        misc_info,
        attrs_inventory_test,
        check,
    ):
        """Check bytes and filename modes for Inventory instantiation."""
        fname = misc_info.FNames.RES

        if source_type in (
            soi.SourceTypes.BytesPlaintext,
            soi.SourceTypes.FnamePlaintext,
        ):
            fname += misc_info.Extensions.DEC
        else:
            fname += misc_info.Extensions.CMP

        source = path_fxn(res_path / fname)

        if source_type in (soi.SourceTypes.BytesPlaintext, soi.SourceTypes.BytesZlib):
            # Passing in the actual inventory contents, and not just the location
            source = soi.readbytes(source)

        # General import, without a specified kwarg
>       with check(msg="general"):
E       TypeError: 'module' object is not callable

tests/test_api_good.py:369: TypeError
_______________________________________________ TestInventory.test_api_inventory_bytes_fname_instantiation[str--fname_plain] _______________________________________________

self = <tests.test_api_good.TestInventory object at 0x7fc9ec37d1c0>, source_type = <SourceTypes.FnamePlaintext: 'fname_plain'>, inv_arg = 'fname_plain'
path_fxn = <class 'str'>, res_path = PosixPath('tests/resource'), misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>
attrs_inventory_test = <function attrs_inventory_test.<locals>.func at 0x7fc9ebf8d3a0>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.parametrize(
        ["source_type", "inv_arg"],
        [
            (soi.SourceTypes.BytesPlaintext, "plaintext"),
            (soi.SourceTypes.BytesZlib, "zlib"),
            (soi.SourceTypes.FnamePlaintext, "fname_plain"),
            (soi.SourceTypes.FnameZlib, "fname_zlib"),
        ],
        ids=(lambda v: v if isinstance(v, str) else ""),
    )
    @pytest.mark.parametrize("path_fxn", PATH_FXNS, ids=PATH_FXN_IDS)
    def test_api_inventory_bytes_fname_instantiation(
        self,
        source_type,
        inv_arg,
        path_fxn,
        res_path,
        misc_info,
        attrs_inventory_test,
        check,
    ):
        """Check bytes and filename modes for Inventory instantiation."""
        fname = misc_info.FNames.RES

        if source_type in (
            soi.SourceTypes.BytesPlaintext,
            soi.SourceTypes.FnamePlaintext,
        ):
            fname += misc_info.Extensions.DEC
        else:
            fname += misc_info.Extensions.CMP

        source = path_fxn(res_path / fname)

        if source_type in (soi.SourceTypes.BytesPlaintext, soi.SourceTypes.BytesZlib):
            # Passing in the actual inventory contents, and not just the location
            source = soi.readbytes(source)

        # General import, without a specified kwarg
>       with check(msg="general"):
E       TypeError: 'module' object is not callable

tests/test_api_good.py:369: TypeError
_______________________________________________ TestInventory.test_api_inventory_bytes_fname_instantiation[str--fname_zlib] ________________________________________________

self = <tests.test_api_good.TestInventory object at 0x7fc9ec37d280>, source_type = <SourceTypes.FnameZlib: 'fname_zlib'>, inv_arg = 'fname_zlib', path_fxn = <class 'str'>
res_path = PosixPath('tests/resource'), misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>
attrs_inventory_test = <function attrs_inventory_test.<locals>.func at 0x7fc9ebf8d3a0>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.parametrize(
        ["source_type", "inv_arg"],
        [
            (soi.SourceTypes.BytesPlaintext, "plaintext"),
            (soi.SourceTypes.BytesZlib, "zlib"),
            (soi.SourceTypes.FnamePlaintext, "fname_plain"),
            (soi.SourceTypes.FnameZlib, "fname_zlib"),
        ],
        ids=(lambda v: v if isinstance(v, str) else ""),
    )
    @pytest.mark.parametrize("path_fxn", PATH_FXNS, ids=PATH_FXN_IDS)
    def test_api_inventory_bytes_fname_instantiation(
        self,
        source_type,
        inv_arg,
        path_fxn,
        res_path,
        misc_info,
        attrs_inventory_test,
        check,
    ):
        """Check bytes and filename modes for Inventory instantiation."""
        fname = misc_info.FNames.RES

        if source_type in (
            soi.SourceTypes.BytesPlaintext,
            soi.SourceTypes.FnamePlaintext,
        ):
            fname += misc_info.Extensions.DEC
        else:
            fname += misc_info.Extensions.CMP

        source = path_fxn(res_path / fname)

        if source_type in (soi.SourceTypes.BytesPlaintext, soi.SourceTypes.BytesZlib):
            # Passing in the actual inventory contents, and not just the location
            source = soi.readbytes(source)

        # General import, without a specified kwarg
>       with check(msg="general"):
E       TypeError: 'module' object is not callable

tests/test_api_good.py:369: TypeError
______________________________________________________________ TestFail.test_clifail_convert_localfile_as_url ______________________________________________________________

self = <tests.test_cli.TestFail object at 0x7fc9ec15d7c0>, scratch_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-447/test_clifail_convert_localfile0')
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>, run_cmdline_test = <function run_cmdline_test.<locals>.func at 0x7fc9eb688550>
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    @pytest.mark.timeout(CLI_TEST_TIMEOUT)
    def test_clifail_convert_localfile_as_url(
        self, scratch_path, misc_info, run_cmdline_test, check
    ):
        """Confirm error when using URL mode on local file."""
        in_path = scratch_path / (misc_info.FNames.INIT + misc_info.Extensions.CMP)

        (scratch_path / (misc_info.FNames.INIT + misc_info.Extensions.DEC)).unlink()

>       with check(msg="path-style"):
E       TypeError: 'module' object is not callable

tests/test_cli.py:482: TypeError
__________________________________________________________________________ test_populate_scratch ___________________________________________________________________________

misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc9ec0fa520>, scratch_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-447/test_populate_scratch0')
check = <module 'pytest_check.check_methods' from '/usr/lib/python3.8/site-packages/pytest_check/check_methods.py'>

    def test_populate_scratch(misc_info, scratch_path, check):
        """Ensure the scratch_path fixture populates the scratch dir correctly."""
        scr_base = misc_info.FNames.INIT.value

        for ext in [_.value for _ in misc_info.Extensions]:
>           with check(msg=ext):
E           TypeError: 'module' object is not callable

tests/test_fixture.py:48: TypeError
========================================================================= short test summary info ==========================================================================
SKIPPED [60] tests/test_api_good.py:499: '--testall' not specified
SKIPPED [60] tests/test_api_good.py:533: '--testall' not specified
SKIPPED [63] tests/test_api_good_nonlocal.py:48: '--nonloc' not specified
SKIPPED [3] tests/test_cli.py:124: Ignore no-change conversions
SKIPPED [60] tests/test_cli.py:226: '--testall' not specified
SKIPPED [12] tests/test_cli_nonlocal.py:57: '--nonloc' not specified
SKIPPED [1] tests/test_flake8_ext.py:50: '--flake8_ext' not specified
XFAIL tests/test_api_fail.py::TestImmutable::test_apifail_changing_immutable_dataobj[True-no_op] - Made mutable to simplify Inventory revision by users
XFAIL tests/test_api_fail.py::TestImmutable::test_apifail_changing_immutable_dataobj[True-str] - Made mutable to simplify Inventory revision by users
XFAIL tests/test_api_fail.py::TestImmutable::test_apifail_changing_immutable_dataobj[False-no_op] - Made mutable to simplify Inventory revision by users
XFAIL tests/test_api_fail.py::TestImmutable::test_apifail_changing_immutable_dataobj[False-str] - Made mutable to simplify Inventory revision by users
XFAIL tests/test_valid_objects.py::test_name_lead_chars[10_\n] - reason: Known invalid name lead char
XFAIL tests/test_valid_objects.py::test_name_lead_chars[35_#] - reason: Known invalid name lead char
FAILED tests/test_api_good.py::TestInventory::test_api_inventory_bytes_fname_instantiation[no_op--plaintext] - TypeError: 'module' object is not callable
FAILED tests/test_api_good.py::TestInventory::test_api_inventory_bytes_fname_instantiation[no_op--zlib] - TypeError: 'module' object is not callable
FAILED tests/test_api_good.py::TestInventory::test_api_inventory_bytes_fname_instantiation[no_op--fname_plain] - TypeError: 'module' object is not callable
FAILED tests/test_api_good.py::TestInventory::test_api_inventory_bytes_fname_instantiation[no_op--fname_zlib] - TypeError: 'module' object is not callable
FAILED tests/test_api_good.py::TestInventory::test_api_inventory_bytes_fname_instantiation[str--plaintext] - TypeError: 'module' object is not callable
FAILED tests/test_api_good.py::TestInventory::test_api_inventory_bytes_fname_instantiation[str--zlib] - TypeError: 'module' object is not callable
FAILED tests/test_api_good.py::TestInventory::test_api_inventory_bytes_fname_instantiation[str--fname_plain] - TypeError: 'module' object is not callable
FAILED tests/test_api_good.py::TestInventory::test_api_inventory_bytes_fname_instantiation[str--fname_zlib] - TypeError: 'module' object is not callable
FAILED tests/test_cli.py::TestFail::test_clifail_convert_localfile_as_url - TypeError: 'module' object is not callable
FAILED tests/test_fixture.py::test_populate_scratch - TypeError: 'module' object is not callable
================================================== 10 failed, 483 passed, 259 skipped, 1 deselected, 6 xfailed in 41.63s ===================================================

To reproduce
I'm packaging 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>

Attachments
N/A

System information

  • Device:
  • OS: Linux x86/64

Python environment
python 3.8.15

Here is list of installed modules in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
appdirs                       1.4.4
asn1crypto                    1.5.1
attrs                         22.1.0
Babel                         2.11.0
bcrypt                        3.2.2
Brlapi                        0.8.3
build                         0.9.0
certifi                       2022.9.24
cffi                          1.15.1
charset-normalizer            3.0.1
contourpy                     1.0.6
cryptography                  38.0.1
cssselect                     1.1.0
cycler                        0.11.0
dictdiffer                    0.9.0
distro                        1.8.0
dnspython                     2.2.1
docutils                      0.19
exceptiongroup                1.0.0
extras                        1.0.0
fixtures                      4.0.0
fonttools                     4.38.0
fuzzywuzzy                    0.18.0
gpg                           1.17.1-unknown
idna                          3.4
imagesize                     1.4.1
importlib-metadata            5.1.0
importlib-resources           5.9.0
iniconfig                     1.1.1
Jinja2                        3.1.2
jsonschema                    4.17.1
kiwisolver                    1.4.4
libcomps                      0.1.19
louis                         3.23.0
lxml                          4.9.1
MarkupSafe                    2.1.1
matplotlib                    3.6.2
numpy                         1.23.1
olefile                       0.46
packaging                     21.3
pbr                           5.9.0
pep517                        0.13.0
Pillow                        9.3.0
pip                           22.3.1
pkgutil_resolve_name          1.3.10
pluggy                        1.0.0
ply                           3.11
pyasn1                        0.4.8
pyasn1-modules                0.2.8
pycparser                     2.21
Pygments                      2.13.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pyrsistent                    0.19.2
pytest                        7.2.0
pytest_check                  1.0.5
python-dateutil               2.8.2
pytz                          2022.4
PyYAML                        6.0
requests                      2.28.1
rpm                           4.17.0
scour                         0.38.2
setuptools                    65.6.3
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        5.3.0
sphinx-issues                 3.0.1
sphinx-removed-in             0.2.1
sphinx-rtd-theme              1.1.1
sphinxcontrib-applehelp       1.0.2.dev20220730
sphinxcontrib-devhelp         1.0.2.dev20220730
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220730
sphinxcontrib-programoutput   0.17
sphinxcontrib-qthelp          1.0.3.dev20220730
sphinxcontrib-serializinghtml 1.1.5
stdio-mgr                     1.0.1
testtools                     2.5.0
tomli                         2.0.1
tpm2-pkcs11-tools             1.33.7
tpm2-pytss                    1.1.0
urllib3                       1.26.12
wheel                         0.38.4
zipp                          3.11.0
@kloczek kloczek added the type: bug 🪲 Something is wrong label Nov 29, 2022
@bskinn
Copy link
Owner

bskinn commented Nov 29, 2022

Update pytest_check to 1.1.2 or higher, the API changed there recently.

@kloczek
Copy link
Author

kloczek commented Nov 29, 2022

With 1.2.0 everything if OK.

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.3.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.3.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/sphobjinv-2.3.1, configfile: tox.ini
plugins: check-1.2.0
collected 759 items

tests/test_api_fail.py ................................xxxx                                                                                                          [  4%]
tests/test_api_good.py ..............................................................................................................s.sssssssssssssssssssssssssssss [ 23%]
sssssssssssssssssssssssssssssss.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.                                                                         [ 35%]
tests/test_api_good_nonlocal.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss                                                                      [ 43%]
tests/test_cli.py ......s...s...s.........s.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.............................                                 [ 58%]
tests/test_cli_nonlocal.py ssssssssssss                                                                                                                              [ 60%]
tests/test_fixture.py .....                                                                                                                                          [ 61%]
tests/test_flake8_ext.py s                                                                                                                                           [ 61%]
tests/test_intersphinx.py ....                                                                                                                                       [ 61%]
tests/test_readme.py s                                                                                                                                               [ 61%]
tests/test_valid_objects.py .............................................x........................x................................................................. [ 79%]
..........................................................................................................................................................           [100%]

========================================================================= short test summary info ==========================================================================
SKIPPED [60] tests/test_api_good.py:499: '--testall' not specified
SKIPPED [60] tests/test_api_good.py:533: '--testall' not specified
SKIPPED [63] tests/test_api_good_nonlocal.py:48: '--nonloc' not specified
SKIPPED [3] tests/test_cli.py:124: Ignore no-change conversions
SKIPPED [60] tests/test_cli.py:226: '--testall' not specified
SKIPPED [12] tests/test_cli_nonlocal.py:57: '--nonloc' not specified
SKIPPED [1] tests/test_flake8_ext.py:50: '--flake8_ext' not specified
SKIPPED [1] tests/test_readme.py:72: '--readme' not specified
XFAIL tests/test_api_fail.py::TestImmutable::test_apifail_changing_immutable_dataobj[True-no_op] - Made mutable to simplify Inventory revision by users
XFAIL tests/test_api_fail.py::TestImmutable::test_apifail_changing_immutable_dataobj[True-str] - Made mutable to simplify Inventory revision by users
XFAIL tests/test_api_fail.py::TestImmutable::test_apifail_changing_immutable_dataobj[False-no_op] - Made mutable to simplify Inventory revision by users
XFAIL tests/test_api_fail.py::TestImmutable::test_apifail_changing_immutable_dataobj[False-str] - Made mutable to simplify Inventory revision by users
XFAIL tests/test_valid_objects.py::test_name_lead_chars[10_\n] - reason: Known invalid name lead char
XFAIL tests/test_valid_objects.py::test_name_lead_chars[35_#] - reason: Known invalid name lead char
=============================================================== 493 passed, 260 skipped, 6 xfailed in 41.46s ===============================================================

Thank you 👍

@kloczek kloczek closed this as completed Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🪲 Something is wrong
Projects
None yet
Development

No branches or pull requests

2 participants