Skip to content

2.1: pytest fails in lupa/tests/test.py::TestOverflowMixin::test_no_overflow unit #266

@kloczek

Description

@kloczek

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> using installer module
  • run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
  • build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-lupa-2.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-lupa-2.1-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network' --import-mode=importlib lupa/tests/__init__.py lupa/tests/test.py
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/lupa-lupa-2.1
configfile: pyproject.toml
collected 317 items

lupa/tests/test.py .................................................................................................................................................................. [ 51%]
...................................................................................................sssssssssss...............F.............................                           [100%]

========================================================================================= FAILURES ==========================================================================================
____________________________________________________________________________ TestOverflowMixin.test_no_overflow _____________________________________________________________________________

self = <lupa.tests.test.TestOverflowMixin object at 0x7ff4c25a3280>

    def test_no_overflow(self):
>       self.assertMathType(0, 'integer')

lupa/tests/test.py:2941:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <lupa.tests.test.TestOverflowMixin object at 0x7ff4c25a3280>, number = 0, math_type = 'integer'

    def assertMathType(self, number, math_type):
>       self.assertEqual(self.lua_type(number), 'number')
E       AttributeError: 'TestOverflowMixin' object has no attribute 'assertEqual'

lupa/tests/test.py:2956: AttributeError
================================================================================== short test summary info ==================================================================================
SKIPPED [1] lupa/tests/test.py:2725: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2610: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2584: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2589: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2580: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2714: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2693: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2702: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2642: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2595: No FastRLock implementation found
SKIPPED [1] lupa/tests/test.py:2600: No FastRLock implementation found
FAILED lupa/tests/test.py::TestOverflowMixin::test_no_overflow - AttributeError: 'TestOverflowMixin' object has no attribute 'assertEqual'
======================================================================== 1 failed, 305 passed, 11 skipped in 13.76s =========================================================================
List of installed modules in build env:
Package            Version
------------------ -----------
build              1.2.1
Cython             3.0.10
exceptiongroup     1.1.3
importlib_metadata 7.1.0
iniconfig          2.0.0
installer          0.7.0
packaging          24.0
pluggy             1.4.0
pyproject_hooks    1.0.0
pytest             8.1.1
python-dateutil    2.9.0.post0
setuptools         69.2.0
tokenize_rt        5.2.0
tomli              2.0.1
wheel              0.43.0
zipp               3.18.1

Please let me know if you need more details or want me to perform some diagnostics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions