Skip to content

8.13.23: pytest cannot find any units #284

@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")

Looks like pytest cannot find any units because it scans only tests_*.py files and all files in tests/ are not with such names.

Here is pytest output:

Details
+ cd python-phonenumbers-8.13.23
+ cd python
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-phonenumbers-8.13.23-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-phonenumbers-8.13.23-2.fc
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-phonenumbers-8.13.23/python
collected 0 items

============================ no tests ran in 0.14s =============================

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions