Skip to content

2.1: pytest is failing in repoze/tm/tests.py::TestMakeTM::test_make_tm_withveto unit #8

Open
@kloczek

Description

@kloczek

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
  • 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/python-repoze-tm2-2.1-7.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-repoze-tm2-2.1-7.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --import-mode=importlib repoze/tm/tests.py
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/repoze.tm2-2.1
plugins: mock-3.6.1, httpbin-1.0.0
collected 26 items

repoze/tm/tests.py ................F.........                                                                                                                        [100%]

================================================================================= FAILURES =================================================================================
_____________________________________________________________________ TestMakeTM.test_make_tm_withveto _____________________________________________________________________

self = <tests.TestMakeTM testMethod=test_make_tm_withveto>

    def test_make_tm_withveto(self):
        from repoze.tm import make_tm
        tm = make_tm(DummyApplication(), {}, 'repoze.tm.tests:fakeveto')
>       self.assertEqual(tm.commit_veto, fakeveto)
E       AssertionError: <function fakeveto at 0x7fe25c361f70> != <function fakeveto at 0x7fe25c669940>

repoze/tm/tests.py:194: AssertionError
============================================================================= warnings summary =============================================================================
repoze/tm/tests.py::TestMakeTM::test_make_tm_withveto
  /home/tkloczko/rpmbuild/BUILDROOT/python-repoze-tm2-2.1-7.fc35.x86_64/usr/lib/python3.8/site-packages/repoze/tm/__init__.py:177: PkgResourcesDeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.
    commit_veto = EntryPoint.parse('x=%s' % commit_veto).load(False)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
FAILED repoze/tm/tests.py::TestMakeTM::test_make_tm_withveto - AssertionError: <function fakeveto at 0x7fe25c361f70> != <function fakeveto at 0x7fe25c669940>
================================================================= 1 failed, 25 passed, 1 warning in 0.47s ==================================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions