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:
```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-faker-19.8.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-faker-19.8.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.2, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/faker-19.8.0
configfile: setup.cfg
plugins: Faker-19.8.0
collected 1837 items
tests/test_decode.py ................................................... [ 2%]
........................................................................ [ 6%]
............ [ 7%]
tests/test_factory.py ....................... [ 8%]
tests/test_generator.py .................. [ 9%]
tests/test_optional.py ..... [ 9%]
tests/test_passport.py ...... [ 10%]
tests/test_providers_formats.py ........................................ [ 12%]
................................................. [ 15%]
tests/test_proxy.py ............................ [ 16%]
tests/test_unique.py ..... [ 16%]
tests/providers/__init__.py ............................................ [ 19%]
. [ 19%]
tests/providers/test_address.py ........................................ [ 21%]
...........................s............................................ [ 25%]
........................................................................ [ 29%]
........................................................................ [ 33%]
........................................................................ [ 37%]
.............. [ 37%]
tests/providers/test_automotive.py ..................................... [ 39%]
...................................... [ 41%]
tests/providers/test_bank.py ........................................... [ 44%]
........................... [ 45%]
tests/providers/test_barcode.py ........................................ [ 47%]
..... [ 48%]
tests/providers/test_color.py .......................................... [ 50%]
. [ 50%]
tests/providers/test_company.py ........................................ [ 52%]
........................... [ 54%]
tests/providers/test_credit_card.py .................. [ 55%]
tests/providers/test_currency.py ...................................... [ 57%]
tests/providers/test_date_time.py ...................................... [ 59%]
...................................................................... [ 63%]
tests/providers/test_dynamic.py ....... [ 63%]
tests/providers/test_emoji.py . [ 63%]
tests/providers/test_enum.py ..... [ 63%]
tests/providers/test_file.py ... [ 64%]
tests/providers/test_geo.py ............................ [ 65%]
tests/providers/test_internet.py ....................................... [ 67%]
................................... [ 69%]
tests/providers/test_isbn.py ...... [ 69%]
tests/providers/test_job.py ................ [ 70%]
tests/providers/test_lorem.py .......................................... [ 73%]
......................................... [ 75%]
tests/providers/test_misc.py ..............s.......s.................... [ 77%]
..... [ 77%]
tests/providers/test_person.py .......FF................................ [ 80%]
................................... [ 82%]
tests/providers/test_phone_number.py ................................... [ 83%]
..................... [ 85%]
tests/providers/test_profile.py .. [ 85%]
tests/providers/test_python.py ..........................s.............. [ 87%]
.............................................. [ 89%]
tests/providers/test_sbn.py .... [ 90%]
tests/providers/test_ssn.py ............................................ [ 92%]
........................................................................ [ 96%]
............ [ 97%]
tests/providers/test_user_agent.py .... [ 97%]
tests/pytest/test_autouse_faker_locale.py .. [ 97%]
tests/pytest/test_autouse_faker_seed.py .. [ 97%]
tests/pytest/test_manual_injection.py .... [ 97%]
tests/pytest/test_unique_clear.py . [ 97%]
tests/pytest/session_overrides/session_locale/test_autouse_faker_locale.py s [ 97%]
s [ 97%]
tests/pytest/session_overrides/session_locale/test_autouse_faker_seed.py s [ 97%]
s [ 98%]
tests/pytest/session_overrides/session_locale/test_manual_injection.py s [ 98%]
sss [ 98%]
tests/sphinx/test_docstring.py ............ [ 98%]
tests/sphinx/test_validator.py ........... [ 99%]
tests/utils/test_utils.py ......... [100%]
=================================== FAILURES ===================================
___________________________ TestLvLV.test_first_name ___________________________
self =
def test_first_name(self):
# General first name
name = self.fake.first_name()
assert name
self.assertIsInstance(name, str)
> assert name in LvProvider.provider.first_names
E AttributeError: type object 'Provider' has no attribute 'provider'
tests/providers/test_person.py:302: AttributeError
___________________________ TestLvLV.test_last_name ____________________________
self =
def test_last_name(self):
# General last name.
name = self.fake.last_name()
assert name
self.assertIsInstance(name, str)
assert name in LvProvider.last_names
# Females last name.
name = self.fake.last_name_female()
assert name
self.assertIsInstance(name, str)
assert name in LvProvider.last_names_female + LvProvider.last_names_unisex
# Females only last name.
> name = self.fake.last_name_unique_to_female()
tests/providers/test_person.py:332:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
attr = 'last_name_unique_to_female'
def __getattr__(self, attr: str) -> Any:
"""
Handles cache access and proxying behavior
:param attr: attribute name
:return: the appropriate attribute
"""
if len(self._factories) == 1:
> return getattr(self._factories[0], attr)
E AttributeError: 'Generator' object has no attribute 'last_name_unique_to_female'
../../BUILDROOT/python-faker-19.8.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/faker/proxy.py:114: AttributeError
=============================== warnings summary ===============================
../../BUILDROOT/python-faker-19.8.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/faker/providers/person/fr_QC/__init__.py:10
tests/test_providers_formats.py::test_no_invalid_formats[fr_QC]
/home/tkloczko/rpmbuild/BUILDROOT/python-faker-19.8.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/faker/providers/person/fr_QC/__init__.py:10: UserWarning: fr_QC locale is deprecated. Please use fr_CA.
warnings.warn("fr_QC locale is deprecated. Please use fr_CA.")
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
SKIPPED [1] tests/providers/test_address.py:531: could not import 'ukpostcodeparser.parser': No module named 'ukpostcodeparser'
SKIPPED [1] ../../../../../usr/lib/python3.8/site-packages/_pytest/unittest.py:371: requires the Python Image Library
SKIPPED [1] ../../../../../usr/lib/python3.8/site-packages/_pytest/unittest.py:371: requires the Python xmltodict Library
SKIPPED [1] tests/providers/test_python.py:282: Only relevant for Python 3.10 and later.
SKIPPED [2] tests/pytest/session_overrides/session_locale/test_autouse_faker_locale.py: This test is skipped by default since it depends on changes in the behavior of session-scoped fixtures. Use a separate pytest run for tests like this with the "--exclusive-faker-session" flag specified.
SKIPPED [2] tests/pytest/session_overrides/session_locale/test_autouse_faker_seed.py: This test is skipped by default since it depends on changes in the behavior of session-scoped fixtures. Use a separate pytest run for tests like this with the "--exclusive-faker-session" flag specified.
SKIPPED [4] tests/pytest/session_overrides/session_locale/test_manual_injection.py: This test is skipped by default since it depends on changes in the behavior of session-scoped fixtures. Use a separate pytest run for tests like this with the "--exclusive-faker-session" flag specified.
FAILED tests/providers/test_person.py::TestLvLV::test_first_name - AttributeE...
FAILED tests/providers/test_person.py::TestLvLV::test_last_name - AttributeEr...
====== 2 failed, 1823 passed, 12 skipped, 2 warnings in 65.49s (0:01:05) =======
```
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
build
with--no-isolation
I'm using during all processes only locally installed modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
Here is list of installed modules in build env