Skip to content

0.5.10: pytest warnings #121

@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:

Details
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-bson-0.5.10-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-bson-0.5.10-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/bson-0.5.10
plugins: trio-0.8.0, mock-3.10.0, hypothesis-6.72.4
collected 31 items

bson/tests/test_array.py ..                                                                                                                                                           [  6%]
bson/tests/test_binary.py ..                                                                                                                                                          [ 12%]
bson/tests/test_boolean.py ..                                                                                                                                                         [ 19%]
bson/tests/test_datetime.py .                                                                                                                                                         [ 22%]
bson/tests/test_decimal.py .                                                                                                                                                          [ 25%]
bson/tests/test_int.py .                                                                                                                                                              [ 29%]
bson/tests/test_int_as_key.py .                                                                                                                                                       [ 32%]
bson/tests/test_non_utf8_binary.py .                                                                                                                                                  [ 35%]
bson/tests/test_object.py .                                                                                                                                                           [ 38%]
bson/tests/test_objectid.py .............                                                                                                                                             [ 80%]
bson/tests/test_random_tree.py .                                                                                                                                                      [ 83%]
bson/tests/test_types.py ..                                                                                                                                                           [ 90%]
bson/tests/test_unknown_handler.py .                                                                                                                                                  [ 93%]
bson/tests/test_uuid.py ..                                                                                                                                                            [100%]

===================================================================================== warnings summary ======================================================================================
bson/tests/test_object.py:7
  /home/tkloczko/rpmbuild/BUILD/bson-0.5.10/bson/tests/test_object.py:7: PytestCollectionWarning: cannot collect test class 'TestData' because it has a __init__ constructor (from: bson/tests/test_object.py)
    class TestData(BSONCoding):

bson/tests/test_array.py::TestArray::test_encoded_order
  /home/tkloczko/rpmbuild/BUILD/bson-0.5.10/bson/tests/test_array.py:78: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(expected, '\'\\xea\\x08\\x00\\x00\\x04lyrics\\x00\\xdd\\x08\\x00\\x00\\x020\\x00\\x14\\x00\\x00\\x00Viva La Vida lyrics\\x00\\x021\\x00\\x01\\x00\\x00\\x00\\x00\\x022\\x00!\\x00\\x00\\x00        I used to rule the world\\x00\\x023\\x00-\\x00\\x00\\x00        Seas would rise when I gave the word\\x00\\x024\\x00)\\x00\\x00\\x00        Now in the morning I sleep alone\\x00\\x025\\x00(\\x00\\x00\\x00        Sweep the streets I used to own\\x00\\x026\\x00\\x01\\x00\\x00\\x00\\x00\\x027\\x00 \\x00\\x00\\x00        I used to roll the dice\\x00\\x028\\x00)\\x00\\x00\\x00        Feel the fear in my enemy\\\'s eyes\\x00\\x029\\x00\\\'\\x00\\x00\\x00        Listen as the crowd would sing\\x00\\x0210\\x008\\x00\\x00\\x00        "Now the old king is dead! Long live the king!"\\x00\\x0211\\x00\\x01\\x00\\x00\\x00\\x00\\x0212\\x00"\\x00\\x00\\x00        One minute I held the key\\x00\\x0213\\x00)\\x00\\x00\\x00        Next the walls were closed on me\\x00\\x0214\\x00/\\x00\\x00\\x00        And I discovered that my castles stand\\x00\\x0215\\x001\\x00\\x00\\x00        Upon pillars of salt and pillars of sand\\x00\\x0216\\x00\\x01\\x00\\x00\\x00\\x00\\x0217\\x00)\\x00\\x00\\x00        I hear Jerusalem bells a ringing\\x00\\x0218\\x00)\\x00\\x00\\x00        Roman Cavalry choirs are singing\\x00\\x0219\\x00*\\x00\\x00\\x00        Be my mirror, my sword and shield\\x00\\x0220\\x00+\\x00\\x00\\x00        My missionaries in a foreign field\\x00\\x0221\\x00\\x01\\x00\\x00\\x00\\x00\\x0222\\x00(\\x00\\x00\\x00        For some reason I can\\\'t explain\\x00\\x0223\\x00$\\x00\\x00\\x00        Once you go there was never\\x00\\x0224\\x00\\x1d\\x00\\x00\\x00        Never an honest word\\x00\\x0225\\x00,\\x00\\x00\\x00        And that was when I ruled the world\\x00\\x0226\\x00\\x01\\x00\\x00\\x00\\x00\\x0227\\x00(\\x00\\x00\\x00        It was the wicked and wild wind\\x00\\x0228\\x00)\\x00\\x00\\x00        Blew down the doors to let me in\\x00\\x0229\\x001\\x00\\x00\\x00        Shattered windows and the sound of drums\\x00\\x0230\\x000\\x00\\x00\\x00        People couldn\\\'t believe what I\\\'d become\\x00\\x0231\\x00\\x01\\x00\\x00\\x00\\x00\\x0232\\x00\\x1d\\x00\\x00\\x00        Revolutionaries wait\\x00\\x0233\\x00&\\x00\\x00\\x00        For my head on a silver plate\\x00\\x0234\\x00)\\x00\\x00\\x00        Just a puppet on a lonely string\\x00\\x0235\\x00+\\x00\\x00\\x00        Oh who would ever want to be king?\\x00\\x0236\\x00\\x01\\x00\\x00\\x00\\x00\\x0237\\x00)\\x00\\x00\\x00        I hear Jerusalem bells a ringing\\x00\\x0238\\x00)\\x00\\x00\\x00        Roman Cavalry choirs are singing\\x00\\x0239\\x00*\\x00\\x00\\x00        Be my mirror, my sword and shield\\x00\\x0240\\x00+\\x00\\x00\\x00        My missionaries in a foreign field\\x00\\x0241\\x00\\x01\\x00\\x00\\x00\\x00\\x0242\\x00(\\x00\\x00\\x00        For some reason I can\\\'t explain\\x00\\x0243\\x00.\\x00\\x00\\x00        I know Saint Peter won\\\'t call my name\\x00\\x0244\\x00\\x1d\\x00\\x00\\x00        Never an honest word\\x00\\x0245\\x00,\\x00\\x00\\x00        But that was when I ruled the world\\x00\\x0246\\x00\\x01\\x00\\x00\\x00\\x00\\x0247\\x00)\\x00\\x00\\x00        I hear Jerusalem bells a ringing\\x00\\x0248\\x00)\\x00\\x00\\x00        Roman Cavalry choirs are singing\\x00\\x0249\\x00*\\x00\\x00\\x00        Be my mirror, my sword and shield\\x00\\x0250\\x00+\\x00\\x00\\x00        My missionaries in a foreign field\\x00\\x0251\\x00\\x01\\x00\\x00\\x00\\x00\\x0252\\x00(\\x00\\x00\\x00        For some reason I can\\\'t explain\\x00\\x0253\\x00.\\x00\\x00\\x00        I know Saint Peter won\\\'t call my name\\x00\\x0254\\x00\\x1d\\x00\\x00\\x00        Never an honest word\\x00\\x0255\\x00,\\x00\\x00\\x00        But that was when I ruled the world\\x00\\x00\\x00\'')

bson/tests/test_array.py::TestArray::test_long_array
  /home/tkloczko/rpmbuild/BUILD/bson-0.5.10/bson/tests/test_array.py:73: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(self.doc, doc2)

bson/tests/test_random_tree.py: 16 warnings
  /home/tkloczko/rpmbuild/BUILD/bson-0.5.10/bson/tests/test_random_tree.py:70: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(p, p2)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================== 31 passed, 19 warnings in 0.21s ========================================================================

Here is list of installed modules in build env

Details
Package                       Version
----------------------------- -----------------
alabaster                     0.7.13
asttokens                     2.2.1
Babel                         2.12.1
backcall                      0.2.0
build                         0.10.0
charset-normalizer            3.1.0
comm                          0.1.3
decorator                     5.1.1
distro                        1.8.0
docutils                      0.19
exceptiongroup                1.0.0
executing                     1.2.0
gpg                           1.19.0
idna                          3.4
imagesize                     1.4.1
importlib-metadata            6.6.0
iniconfig                     2.0.0
installer                     0.7.0
ipykernel                     6.22.0
ipython                       8.12.0
ipython-genutils              0.2.0
jedi                          0.18.2
Jinja2                        3.1.2
libcomps                      0.1.19
MarkupSafe                    2.1.2
matplotlib-inline             0.1.6
nest-asyncio                  1.5.6
packaging                     23.1
parso                         0.8.3
pexpect                       4.8.0
pickleshare                   0.7.5
pluggy                        1.0.0
prompt-toolkit                3.0.38
ptyprocess                    0.7.0
pure-eval                     0.2.2
Pygments                      2.15.1
pyproject_hooks               1.0.0
pytest                        7.3.1
python-dateutil               2.8.2
pytz                          2023.2
requests                      2.28.2
setuptools                    67.7.2
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        6.2.1
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.2.dev20230415
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20230415
sphinxcontrib-qthelp          1.0.3.dev20230415
sphinxcontrib-serializinghtml 1.1.5
stack-data                    0.6.2
tomli                         2.0.1
traitlets                     5.9.0
typing_extensions             4.5.0
urllib3                       1.26.15
wcwidth                       0.2.6
wheel                         0.40.0
zipp                          3.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions