pytest icon indicating copy to clipboard operation
pytest copied to clipboard

7.1.2: `UserWarning` in _pytest/fixtures.py

Open kloczek opened this issue 3 years ago • 3 comments

  • [x] a detailed description of the bug or problem you are having
  • [x] output of pip list from the virtual environment you are using
  • [x] pytest and operating system versions
  • [x] minimal example if possible

Testting rdflib-sqlalchemy (http://github.com/RDFLib/rdflib-sqlalchemy/) found warning which points on pytest code

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-sqlalchemy-0.5.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-sqlalchemy-0.5.3-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/rdflib-sqlalchemy-0.5.3, configfile: pytest.ini, testpaths: test
collected 16 items / 4 skipped

test/test_aggregate_graphs.py ..                                                                                                                                     [ 12%]
test/test_sqlalchemy.py ...........                                                                                                                                  [ 81%]
test/test_store_performance.py ..                                                                                                                                    [ 93%]
test/test_type_to_term_combination.py .                                                                                                                              [100%]

============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/_pytest/fixtures.py:227
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:227: UserWarning: Code: _pytestfixturefunction is not defined in namespace SDO
    fixturemarker: Optional[FixtureFunctionMarker] = getattr(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] test/test_sqlalchemy_mysql.py:20: MySQLdb not found, skipping MySQL tests
SKIPPED [1] test/test_sqlalchemy_postgresql.py:10: psycopg2 not installed, skipping PgSQL tests
SKIPPED [1] test/test_sqlalchemy_postgresql_pg8000.py:11: pg8000 not installed, skipping PgSQL tests
SKIPPED [1] test/test_sqlalchemy_sqlite.py:13: SQLite not under test
================================================================ 16 passed, 4 skipped, 1 warning in 13.90s =================================================================

List of modules installed in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
appdirs                       1.4.4
attrs                         21.4.0
Babel                         2.10.1
Brlapi                        0.8.3
build                         0.7.0
charset-normalizer            2.0.12
codespell                     2.1.0
cycler                        0.11.0
distro                        1.7.0
docutils                      0.17.1
extras                        1.0.0
fixtures                      4.0.0
fonttools                     4.33.3
gpg                           1.17.1-unknown
greenlet                      1.1.2
idna                          3.3
imagesize                     1.3.0
importlib-metadata            4.11.3
iniconfig                     1.1.1
isodate                       0.6.1
Jinja2                        3.1.1
kiwisolver                    1.3.2
libcomps                      0.1.18
louis                         3.21.0
lxml                          4.8.0
MarkupSafe                    2.1.1
matplotlib                    3.5.1
numpy                         1.22.3
olefile                       0.46
packaging                     21.3
pbr                           5.8.1
pep517                        0.12.0
Pillow                        9.1.1
pip                           22.0.4
pluggy                        1.0.0
py                            1.11.0
Pygments                      2.12.0
PyGObject                     3.42.1
pyparsing                     3.0.9
pytest                        7.1.2
python-dateutil               2.8.2
pytz                          2022.1
rdflib                        6.1.1
requests                      2.27.1
rpm                           4.17.0
scour                         0.38.2
setuptools                    62.2.0
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        4.5.0
sphinxcontrib-applehelp       1.0.2.dev20220410
sphinxcontrib-devhelp         1.0.2.dev20220410
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220410
sphinxcontrib-qthelp          1.0.3.dev20220410
sphinxcontrib-serializinghtml 1.1.5
SQLAlchemy                    1.4.36.dev0
testtools                     2.5.0
tomli                         2.0.1
urllib3                       1.26.9
wheel                         0.37.1
zipp                          3.8.0

pytest: 7.1.2 OS: Linux x86/64

kloczek avatar May 22 '22 07:05 kloczek

I'm not convinced that this is a pytest bug; looking at the source location and trying to reproduce it seems fine? I'd guess that some other code is patching something in a weird way.

Zac-HD avatar Jun 25 '22 06:06 Zac-HD

Which one code and in what "weird way"?

kloczek avatar Jun 25 '22 10:06 kloczek

@Zac-HD im under the impression that the warning comes from fixture parsing a magic object in that library

RonnyPfannschmidt avatar Jun 25 '22 10:06 RonnyPfannschmidt

Closing because we don't have the needed information to resolve this, happy to reopen if that changes 😕

Zac-HD avatar Sep 27 '22 05:09 Zac-HD