Closed kloczek closed 1 year ago
Here is pytest output:
~testdir
is a builtin fixture directly from pytest itself. testdir
has been deprecated, but it doesn't seem to have been removed yet. Has the rpm for pytest maybe dropped it prematurely somehow?~
~Regardless, with testdir
being deprecated it would be good for pytest-twisted to prepare for its removal. We may run into some hassle with the still retained Python 2 support. We'll see.~
Oops, that deprecation link is only about Directly constructing/calling the following classes/functions
. So maybe nevermind about that and we just need to debug why your pytest doesn't have testdir
.
Oops, that deprecation link is only about
Directly constructing/calling the following classes/functions
. So maybe nevermind about that and we just need to debug why your pytest doesn't havetestdir
.
FYI I'm using pytest 7.1.2.
[tkloczko@devel-g2v SPECS]$ rpm -ql python-pytest | grep testdir -i
[tkloczko@devel-g2v SPECS]$
From pytest changelog:
pytest 6.2.0 (2020-12-12) Breaking Changes issue #7808: pytest now supports python3.6+ only.
Deprecations issue #7469: Directly constructing/calling the following classes/functions is now deprecated:
_pytest.cacheprovider.Cache
_pytest.cacheprovider.Cache.for_config()
_pytest.cacheprovider.Cache.clear_cache()
_pytest.cacheprovider.Cache.cache_dir_from_config()
_pytest.capture.CaptureFixture
_pytest.fixtures.FixtureRequest
_pytest.fixtures.SubRequest
_pytest.logging.LogCaptureFixture
_pytest.pytester.Pytester
_pytest.pytester.Testdir <<<=== HERE
_pytest.recwarn.WarningsRecorder
_pytest.recwarn.WarningsChecker
_pytest.tmpdir.TempPathFactory
_pytest.tmpdir.TempdirFactory
These have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 8.0.0.
So looks like that fixture has been removed from pytest ~1.5 years ago.
Sorry I missed this. But Directly constructing/calling the following classes/functions is now deprecated
doesn't say the fixture is gone or going away. Just that you have to use them as fixtures instead of instantiating the class yourself.
To double check, here's the class and fixture still present in the code.
https://github.com/pytest-dev/pytest/blob/fab696dcd1ecd621ed05d2552b7d790ab143efe5/src/_pytest/legacypath.py#L41 https://github.com/pytest-dev/pytest/blob/fab696dcd1ecd621ed05d2552b7d790ab143efe5/src/_pytest/legacypath.py#L260
And in the docs.
https://docs.pytest.org/en/7.1.x/reference/reference.html?highlight=testdir#pytest.Testdir https://docs.pytest.org/en/7.1.x/reference/reference.html?highlight=testdir#std-fixture-testdir
Maybe somehow the LegacyTestdirPlugin
has been explicitly disabled in your setup?
Just tested 1.14.0 and now all looks good
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-twisted-1.14.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-twisted-1.14.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' -q
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.18, pytest-7.4.0, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-twisted-1.14.0
configfile: pytest.ini
plugins: twisted-1.14.0, hypothesis-6.82.0
collected 60 items
testing/test_basic.py .....................................ss.ss.................. [100%]
================================================================================== short test summary info ==================================================================================
SKIPPED [2] testing/test_basic.py:77: reactor is default not qt5reactor
SKIPPED [2] testing/test_basic.py:77: reactor is default not asyncio
============================================================================== 56 passed, 4 skipped in 58.02s ===============================================================================
Thank you 👍
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 --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesI cannot find which one pytest extension provides missing
testdir
fixture.