Hello community, here is the log from the commit of package python-Faker for openSUSE:Factory checked in at 2020-06-11 14:45:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Faker (Old) and /work/SRC/openSUSE:Factory/.python-Faker.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Faker" Thu Jun 11 14:45:21 2020 rev:18 rq:812811 version:4.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Faker/python-Faker.changes 2020-05-04 18:33:40.628215078 +0200 +++ /work/SRC/openSUSE:Factory/.python-Faker.new.3606/python-Faker.changes 2020-06-11 14:45:52.757588282 +0200 @@ -1,0 +2,11 @@ +Tue Jun 9 07:53:47 UTC 2020 - Tomáš Chvátal <[email protected]> + +- Update to 4.1.0: + * Add pytest plugin. Thanks @malefice. + * Fix phone numbers for es_ES. Thanks @pablofm. + * Fix uuid provider to return a uuid4 object when cast_to is set to None. Thanks @rodrigondec. + * Update names for es_ES person provider. Thanks @mondeja. + * Add provider for sk_SK birth_number. Thanks @eumiro. + * Add day_of_week and month_name for de_DE provider. Thanks @eumiro. + +------------------------------------------------------------------- Old: ---- Faker-4.0.3.tar.gz New: ---- Faker-4.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Faker.spec ++++++ --- /var/tmp/diff_new_pack.o40PH8/_old 2020-06-11 14:45:54.013591941 +0200 +++ /var/tmp/diff_new_pack.o40PH8/_new 2020-06-11 14:45:54.013591941 +0200 @@ -20,7 +20,7 @@ %define oldpython python %global skip_python2 1 Name: python-Faker -Version: 4.0.3 +Version: 4.1.0 Release: 0 Summary: Python package that generates fake data License: MIT @@ -60,7 +60,6 @@ # Remove pre-existing bytecode files in the sdist find . -name '*.py[co]' -delete # do not hardcode versions -sed -i -e 's:"pytest>=3.8.0,<3.9":"pytest>=3.8.0":g' setup.py sed -i -e 's:==:>=:g' setup.py %build ++++++ Faker-4.0.3.tar.gz -> Faker-4.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/CHANGELOG.rst new/Faker-4.1.0/CHANGELOG.rst --- old/Faker-4.0.3/CHANGELOG.rst 2020-04-13 21:38:01.000000000 +0200 +++ new/Faker-4.1.0/CHANGELOG.rst 2020-05-12 17:20:18.000000000 +0200 @@ -1,7 +1,17 @@ Changelog ========= -`4.0.3 - 13-April-2019 <https://github.com/joke2k/faker/compare/v4.0.2...v4.0.3>`__ +`4.1.0 - 12-May-2020 <https://github.com/joke2k/faker/compare/v4.0.3...v4.1.0>`__ +--------------------------------------------------------------------------------- + +* Add ``pytest`` plugin. Thanks @malefice. +* Fix phone numbers for ``es_ES``. Thanks @pablofm. +* Fix ``uuid`` provider to return a ``uuid4`` object when ``cast_to`` is set to ``None``. Thanks @rodrigondec. +* Update names for ``es_ES`` person provider. Thanks @mondeja. +* Add provider for ``sk_SK`` ``birth_number``. Thanks @eumiro. +* Add ``day_of_week`` and ``month_name`` for ``de_DE`` provider. Thanks @eumiro. + +`4.0.3 - 13-April-2020 <https://github.com/joke2k/faker/compare/v4.0.2...v4.0.3>`__ ----------------------------------------------------------------------------------- * Fixed ``MSISDN`` for ``pt_BR`` to return only mobile numbers. Thanks @rodrigondec. @@ -18,7 +28,7 @@ * Added color provider for ``no_NO`` license plates. Thanks @bjorskog. * Made ``value_types`` a keyword argument in ``python`` provider. Thanks @slafs. -`4.0.2 - 11-March-2019 <https://github.com/joke2k/faker/compare/v4.0.1...v4.0.2>`__ +`4.0.2 - 11-March-2020 <https://github.com/joke2k/faker/compare/v4.0.1...v4.0.2>`__ ----------------------------------------------------------------------------------- * Add more data for ``ko_KR`` address provider. Thanks @alstn2468. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/Faker.egg-info/PKG-INFO new/Faker-4.1.0/Faker.egg-info/PKG-INFO --- old/Faker-4.0.3/Faker.egg-info/PKG-INFO 2020-04-13 21:40:42.000000000 +0200 +++ new/Faker-4.1.0/Faker.egg-info/PKG-INFO 2020-05-12 17:21:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: Faker -Version: 4.0.3 +Version: 4.1.0 Summary: Faker is a Python package that generates fake data for you. Home-page: https://github.com/joke2k/faker Author: joke2k @@ -88,6 +88,12 @@ # 'Wellington Koelpin II' # 'Ms. Karley Kiehn V' + Pytest fixtures + --------------- + + ``Faker`` also has its own ``pytest`` plugin which provides a ``faker`` fixture you can use in your + tests. Please check out the `pytest fixture docs` to learn more. + Providers --------- @@ -386,6 +392,9 @@ consistent across patch versions. If you hardcode results in your test, make sure you pinned the version of ``Faker`` down to the patch number. + If you are using ``pytest``, you can seed the ``faker`` fixture by defining a ``faker_seed`` + fixture. Please check out the `pytest fixture docs` to learn more. + Tests ----- @@ -432,6 +441,7 @@ .. _extended docs: https://faker.readthedocs.io/en/stable/ .. _bundled providers: https://faker.readthedocs.io/en/stable/providers.html .. _community providers: https://faker.readthedocs.io/en/stable/communityproviders.html + .. _pytest fixture docs: https://faker.readthedocs.io/en/master/pytest-fixtures.html .. _LICENSE: https://github.com/joke2k/faker/blob/master/LICENSE.txt .. _CONTRIBUTING: https://github.com/joke2k/faker/blob/master/CONTRIBUTING.rst .. _Factory Boy: https://github.com/FactoryBoy/factory_boy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/Faker.egg-info/SOURCES.txt new/Faker-4.1.0/Faker.egg-info/SOURCES.txt --- old/Faker-4.0.3/Faker.egg-info/SOURCES.txt 2020-04-13 21:40:42.000000000 +0200 +++ new/Faker-4.1.0/Faker.egg-info/SOURCES.txt 2020-05-12 17:21:34.000000000 +0200 @@ -22,6 +22,9 @@ faker/factory.py faker/generator.py faker/proxy.py +faker/contrib/__init__.py +faker/contrib/pytest/__init__.py +faker/contrib/pytest/plugin.py faker/providers/__init__.py faker/providers/address/__init__.py faker/providers/address/cs_CZ/__init__.py @@ -162,6 +165,7 @@ faker/providers/date_time/__init__.py faker/providers/date_time/ar_AA/__init__.py faker/providers/date_time/ar_EG/__init__.py +faker/providers/date_time/de_DE/__init__.py faker/providers/date_time/en_PH/__init__.py faker/providers/date_time/en_US/__init__.py faker/providers/date_time/fil_PH/__init__.py @@ -464,6 +468,17 @@ tests/providers/test_python.py tests/providers/test_ssn.py tests/providers/test_user_agent.py +tests/pytest/__init__.py +tests/pytest/test_autouse_faker_locale.py +tests/pytest/test_autouse_faker_seed.py +tests/pytest/test_manual_injection.py +tests/pytest/session_overrides/__init__.py +tests/pytest/session_overrides/conftest.py +tests/pytest/session_overrides/session_locale/__init__.py +tests/pytest/session_overrides/session_locale/conftest.py +tests/pytest/session_overrides/session_locale/test_autouse_faker_locale.py +tests/pytest/session_overrides/session_locale/test_autouse_faker_seed.py +tests/pytest/session_overrides/session_locale/test_manual_injection.py tests/utils/__init__.py tests/utils/random_state.json tests/utils/test_utils.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/Faker.egg-info/entry_points.txt new/Faker-4.1.0/Faker.egg-info/entry_points.txt --- old/Faker-4.0.3/Faker.egg-info/entry_points.txt 2020-04-13 21:40:42.000000000 +0200 +++ new/Faker-4.1.0/Faker.egg-info/entry_points.txt 2020-05-12 17:21:34.000000000 +0200 @@ -1,3 +1,6 @@ [console_scripts] faker = faker.cli:execute_from_command_line +[pytest11] +faker = faker.contrib.pytest.plugin + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/PKG-INFO new/Faker-4.1.0/PKG-INFO --- old/Faker-4.0.3/PKG-INFO 2020-04-13 21:40:43.000000000 +0200 +++ new/Faker-4.1.0/PKG-INFO 2020-05-12 17:21:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: Faker -Version: 4.0.3 +Version: 4.1.0 Summary: Faker is a Python package that generates fake data for you. Home-page: https://github.com/joke2k/faker Author: joke2k @@ -88,6 +88,12 @@ # 'Wellington Koelpin II' # 'Ms. Karley Kiehn V' + Pytest fixtures + --------------- + + ``Faker`` also has its own ``pytest`` plugin which provides a ``faker`` fixture you can use in your + tests. Please check out the `pytest fixture docs` to learn more. + Providers --------- @@ -386,6 +392,9 @@ consistent across patch versions. If you hardcode results in your test, make sure you pinned the version of ``Faker`` down to the patch number. + If you are using ``pytest``, you can seed the ``faker`` fixture by defining a ``faker_seed`` + fixture. Please check out the `pytest fixture docs` to learn more. + Tests ----- @@ -432,6 +441,7 @@ .. _extended docs: https://faker.readthedocs.io/en/stable/ .. _bundled providers: https://faker.readthedocs.io/en/stable/providers.html .. _community providers: https://faker.readthedocs.io/en/stable/communityproviders.html + .. _pytest fixture docs: https://faker.readthedocs.io/en/master/pytest-fixtures.html .. _LICENSE: https://github.com/joke2k/faker/blob/master/LICENSE.txt .. _CONTRIBUTING: https://github.com/joke2k/faker/blob/master/CONTRIBUTING.rst .. _Factory Boy: https://github.com/FactoryBoy/factory_boy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/README.rst new/Faker-4.1.0/README.rst --- old/Faker-4.0.3/README.rst 2020-04-13 21:24:31.000000000 +0200 +++ new/Faker-4.1.0/README.rst 2020-05-12 17:20:18.000000000 +0200 @@ -80,6 +80,12 @@ # 'Wellington Koelpin II' # 'Ms. Karley Kiehn V' +Pytest fixtures +--------------- + +``Faker`` also has its own ``pytest`` plugin which provides a ``faker`` fixture you can use in your +tests. Please check out the `pytest fixture docs` to learn more. + Providers --------- @@ -378,6 +384,9 @@ consistent across patch versions. If you hardcode results in your test, make sure you pinned the version of ``Faker`` down to the patch number. +If you are using ``pytest``, you can seed the ``faker`` fixture by defining a ``faker_seed`` +fixture. Please check out the `pytest fixture docs` to learn more. + Tests ----- @@ -424,6 +433,7 @@ .. _extended docs: https://faker.readthedocs.io/en/stable/ .. _bundled providers: https://faker.readthedocs.io/en/stable/providers.html .. _community providers: https://faker.readthedocs.io/en/stable/communityproviders.html +.. _pytest fixture docs: https://faker.readthedocs.io/en/master/pytest-fixtures.html .. _LICENSE: https://github.com/joke2k/faker/blob/master/LICENSE.txt .. _CONTRIBUTING: https://github.com/joke2k/faker/blob/master/CONTRIBUTING.rst .. _Factory Boy: https://github.com/FactoryBoy/factory_boy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/VERSION new/Faker-4.1.0/VERSION --- old/Faker-4.0.3/VERSION 2020-04-13 21:40:06.000000000 +0200 +++ new/Faker-4.1.0/VERSION 2020-05-12 17:20:35.000000000 +0200 @@ -1 +1 @@ -4.0.3 +4.1.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/faker/__init__.py new/Faker-4.1.0/faker/__init__.py --- old/Faker-4.0.3/faker/__init__.py 2020-04-13 21:40:06.000000000 +0200 +++ new/Faker-4.1.0/faker/__init__.py 2020-05-12 17:20:35.000000000 +0200 @@ -2,4 +2,4 @@ from faker.generator import Generator # noqa F401 from faker.proxy import Faker # noqa F401 -VERSION = '4.0.3' +VERSION = '4.1.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/faker/contrib/pytest/plugin.py new/Faker-4.1.0/faker/contrib/pytest/plugin.py --- old/Faker-4.0.3/faker/contrib/pytest/plugin.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/faker/contrib/pytest/plugin.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,37 @@ +import pytest + +from faker import Faker +from faker.config import DEFAULT_LOCALE + +DEFAULT_SEED = 0 + + [email protected](scope='session', autouse=True) +def _session_faker(request): + """Fixture that stores the session level ``Faker`` instance. + + This fixture is internal and is only meant for use within the project. + Third parties should instead use the ``faker`` fixture for their tests. + """ + if 'faker_session_locale' in request.fixturenames: + locale = request.getfixturevalue('faker_session_locale') + else: + locale = [DEFAULT_LOCALE] + return Faker(locale=locale) + + [email protected]() +def faker(request): + """Fixture that returns a seeded and suitable ``Faker`` instance.""" + if 'faker_locale' in request.fixturenames: + locale = request.getfixturevalue('faker_locale') + fake = Faker(locale=locale) + else: + fake = request.getfixturevalue('_session_faker') + + seed = DEFAULT_SEED + if 'faker_seed' in request.fixturenames: + seed = request.getfixturevalue('faker_seed') + fake.seed_instance(seed=seed) + + return fake diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/faker/providers/date_time/de_DE/__init__.py new/Faker-4.1.0/faker/providers/date_time/de_DE/__init__.py --- old/Faker-4.0.3/faker/providers/date_time/de_DE/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/faker/providers/date_time/de_DE/__init__.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,37 @@ +from .. import Provider as DateTimeProvider + + +class Provider(DateTimeProvider): + + DAY_NAMES = { + "0": "Sonntag", + "1": "Montag", + "2": "Dienstag", + "3": "Mittwoch", + "4": "Donnerstag", + "5": "Freitag", + "6": "Samstag", + } + + MONTH_NAMES = { + "01": "Januar", + "02": "Februar", + "03": "März", + "04": "April", + "05": "Mai", + "06": "Juni", + "07": "Juli", + "08": "August", + "09": "September", + "10": "Oktober", + "11": "November", + "12": "Dezember", + } + + def day_of_week(self): + day = self.date("%w") + return self.DAY_NAMES[day] + + def month_name(self): + month = self.month() + return self.MONTH_NAMES[month] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/faker/providers/misc/__init__.py new/Faker-4.1.0/faker/providers/misc/__init__.py --- old/Faker-4.0.3/faker/providers/misc/__init__.py 2020-04-13 21:24:31.000000000 +0200 +++ new/Faker-4.1.0/faker/providers/misc/__init__.py 2020-05-12 17:20:18.000000000 +0200 @@ -87,12 +87,20 @@ return res.hexdigest() def uuid4(self, cast_to=str): - """Generate a random UUID4 object and cast it to another type using a callable ``cast_to``. + """Generate a random UUID4 object and cast it to another type if specified using a callable ``cast_to``. By default, ``cast_to`` is set to ``str``. + + May be called with ``cast_to=None`` to return a full-fledged ``UUID``. + + :sample: + :sample: cast_to=None """ # Based on http://stackoverflow.com/q/41186818 - return cast_to(uuid.UUID(int=self.generator.random.getrandbits(128), version=4)) + generated_uuid = uuid.UUID(int=self.generator.random.getrandbits(128), version=4) + if cast_to is not None: + generated_uuid = cast_to(generated_uuid) + return generated_uuid def password( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/faker/providers/person/es_ES/__init__.py new/Faker-4.1.0/faker/providers/person/es_ES/__init__.py --- old/Faker-4.0.3/faker/providers/person/es_ES/__init__.py 2020-01-14 19:13:54.000000000 +0100 +++ new/Faker-4.1.0/faker/providers/person/es_ES/__init__.py 2020-05-12 17:20:18.000000000 +0200 @@ -30,208 +30,183 @@ formats = formats_male + formats_female + # 477 male first names, alphabetically. + # Source: Álvaro Mondéjar Rubio <[email protected]> first_names_male = ( - 'Antonio', - 'Jose', - 'Manuel', - 'Francisco', - 'Juan', - 'David', - 'Jose Antonio', - 'Jose Luis', - 'Javier', - 'Jesús', - 'Francisco Javier', - 'Daniel', - 'Carlos', - 'Miguel', - 'Rafael', - 'Jose Manuel', - 'Alejandro', - 'Pedro', - 'Ángel', - 'Miguel Ángel', - 'Jose Maria', - 'Fernando', - 'Luís', - 'Pablo', - 'Sergio', - 'Jorge', - 'Alberto', - 'Juan Carlos', - 'Juan José', - 'Diego', - 'Alvaro', - 'Adrián', - 'Juan Antonio', - 'Enrique', - 'Raul', - 'Ramon', - 'Vicente', - 'Ivan', - 'Ruben', - 'Andrés', - 'Joaquin', + 'Aarón', 'Abel', 'Abilio', 'Abraham', 'Adalberto', + 'Adelardo', 'Adolfo', 'Adrián', 'Adán', 'Agapito', 'Agustín', + 'Aitor', 'Albano', 'Albert', 'Alberto', 'Albino', 'Alcides', + 'Ale', 'Alejandro', 'Alejo', 'Alex', 'Alfonso', 'Alfredo', + 'Alonso', 'Amado', 'Amador', 'Amancio', 'Amando', 'Amaro', + 'Ambrosio', 'Amor', 'Américo', 'Amílcar', 'Anacleto', 'Anastasio', + 'Andrés', 'Andrés Felipe', 'Angelino', 'Anselmo', 'Antonio', + 'Aníbal', 'Apolinar', 'Ariel', 'Aristides', 'Armando', + 'Arsenio', 'Artemio', 'Arturo', 'Asdrubal', 'Atilio', 'Augusto', + 'Aureliano', 'Aurelio', 'Baldomero', 'Balduino', 'Baltasar', + 'Bartolomé', 'Basilio', 'Baudelio', 'Bautista', 'Benigno', + 'Benito', 'Benjamín', 'Bernabé', 'Bernardino', 'Bernardo', + 'Berto', 'Blas', 'Bonifacio', 'Borja', 'Bruno', 'Buenaventura', + 'Calisto', 'Calixto', 'Camilo', 'Candelario', 'Carlito', + 'Carlos', 'Carmelo', 'Casemiro', 'Cayetano', 'Cebrián', + 'Cecilio', 'Ceferino', 'Celestino', 'Celso', 'Cesar', 'Che', + 'Chema', 'Chucho', 'Chus', 'Chuy', 'Cipriano', 'Ciriaco', + 'Cirino', 'Ciro', 'Ciríaco', 'Claudio', 'Clemente', 'Cleto', + 'Clímaco', 'Conrado', 'Cornelio', 'Cosme', 'Cristian', + 'Cristian', 'Cristóbal', 'Cruz', 'Curro', 'Custodio', 'Cándido', + 'César', 'Damián', 'Dan', 'Dani', 'Daniel', 'Danilo', 'Darío', + 'David', 'Demetrio', 'Desiderio', 'Diego', 'Dimas', 'Dionisio', + 'Domingo', 'Donato', 'Duilio', 'Edelmiro', 'Edgardo', 'Edmundo', + 'Edu', 'Eduardo', 'Efraín', 'Eladio', 'Eleuterio', 'Eligio', + 'Eliseo', 'Eloy', 'Elpidio', 'Elías', 'Emigdio', 'Emiliano', + 'Emilio', 'Enrique', 'Epifanio', 'Erasmo', 'Eric', 'Ernesto', + 'Espiridión', 'Esteban', 'Eugenio', 'Eusebio', 'Eustaquio', + 'Eutimio', 'Eutropio', 'Evaristo', 'Ezequiel', 'Fabio', 'Fabián', + 'Fabricio', 'Faustino', 'Fausto', 'Federico', 'Feliciano', + 'Felipe', 'Felix', 'Fermín', 'Fernando', 'Fidel', 'Fito', + 'Flavio', 'Florencio', 'Florentino', 'Fortunato', 'Francisco', + 'Francisco Javier', 'Francisco Jose', 'Fulgencio', 'Félix', 'Gabino', + 'Gabriel', 'Galo', 'Gaspar', 'Gastón', 'Geraldo', 'Gerardo', + 'Germán', 'Gervasio', 'Gerónimo', 'Gil', 'Gilberto', 'Glauco', + 'Godofredo', 'Gonzalo', 'Goyo', 'Graciano', 'Gregorio', + 'Guadalupe', 'Guillermo', 'Guiomar', 'Gustavo', 'Haroldo', + 'Hector', 'Heliodoro', 'Heraclio', 'Herberto', 'Heriberto', + 'Hermenegildo', 'Herminio', 'Hernando', 'Hernán', 'Hilario', + 'Hipólito', 'Horacio', 'Hugo', 'Humberto', 'Héctor', 'Ibán', + 'Ignacio', 'Iker', 'Ildefonso', 'Inocencio', 'Isaac', 'Isaías', + 'Isidoro', 'Isidro', 'Ismael', 'Iván', 'Jacinto', 'Jacobo', + 'Jafet', 'Jaime', 'Javi', 'Javier', 'Jenaro', 'Jeremías', + 'Jerónimo', 'Jesús', 'Joan', 'Joaquín', 'Joel', 'Jonatan', 'Jordi', + 'Jordán', 'Jorge', 'Jose', 'Jose Angel', 'Jose Antonio', + 'Jose Carlos', 'Jose Francisco', 'Jose Ignacio', 'Jose Luis', + 'Jose Manuel', 'Jose Miguel', 'Jose Ramón', 'Josep', 'Josué', 'José', + 'José Antonio', 'José Luis', 'José Manuel', 'José Mari', + 'José María', 'José Ángel', 'Juan', 'Juan Antonio', + 'Juan Bautista', 'Juan Carlos', 'Juan Francisco', 'Juan José', + 'Juan Luis', 'Juan Manuel', 'Juan Pablo', 'Juanito', 'Julio', + 'Julio César', 'Julián', 'Kike', 'Lalo', 'Leandro', 'Leocadio', + 'Leonardo', 'Leoncio', 'Leonel', 'Leopoldo', 'León', 'Lino', + 'Lisandro', 'Lope', 'Lorenzo', 'Loreto', 'Lucas', 'Lucho', + 'Luciano', 'Lucio', 'Luis', 'Luis Miguel', 'Luis Ángel', 'Lupe', + 'Luís', 'Lázaro', 'Macario', 'Manolo', 'Manu', 'Manuel', + 'Marc', 'Marcelino', 'Marcelo', 'Marcial', 'Marciano', + 'Marcio', 'Marco', 'Marcos', 'Mariano', 'Marino', 'Mario', + 'Martin', 'Martín', 'María', 'Mateo', 'Matías', 'Mauricio', + 'Maxi', 'Maximiano', 'Maximiliano', 'Maximino', 'Melchor', + 'Miguel', 'Miguel Ángel', 'Modesto', 'Mohamed', 'Moisés', + 'Moreno', 'Máximo', 'Nacho', 'Nacio', 'Nando', 'Narciso', + 'Natalio', 'Natanael', 'Nazaret', 'Nazario', 'Nicanor', 'Nico', + 'Nicodemo', 'Nicolás', 'Nilo', 'Norberto', 'Noé', 'Néstor', + 'Octavio', 'Olegario', 'Omar', 'Onofre', 'Osvaldo', 'Ovidio', + 'Pablo', 'Paco', 'Pancho', 'Pascual', 'Pastor', 'Patricio', + 'Paulino', 'Pedro', 'Pelayo', 'Pepe', 'Pepito', 'Plinio', + 'Plácido', 'Poncio', 'Porfirio', 'Primitivo', 'Prudencio', + 'Pánfilo', 'Pío', 'Quique', 'Quirino', 'Rafa', 'Rafael', + 'Raimundo', 'Ramiro', 'Ramón', 'Raúl', 'Reinaldo', 'Remigio', + 'Renato', 'René', 'Reyes', 'Reynaldo', 'Ricardo', 'Rico', + 'Roberto', 'Rodolfo', 'Rodrigo', 'Rogelio', 'Rolando', 'Roldán', + 'Román', 'Roque', 'Rosario', 'Rosendo', 'Ruben', 'Rubén', + 'Rufino', 'Ruperto', 'Ruy', 'Régulo', 'Rómulo', 'Sabas', + 'Salomón', 'Salvador', 'Samu', 'Samuel', 'Sancho', 'Sandalio', + 'Santiago', 'Santos', 'Saturnino', 'Sebastian', 'Sebastián', + 'Segismundo', 'Sergio', 'Seve', 'Severiano', 'Severino', 'Severo', + 'Sigfrido', 'Silvestre', 'Silvio', 'Simón', 'Sosimo', 'Tadeo', + 'Telmo', 'Teo', 'Teobaldo', 'Teodoro', 'Teodosio', 'Teófilo', + 'Tiburcio', 'Timoteo', 'Tito', 'Tomás', 'Toni', 'Toribio', 'Toño', + 'Trinidad', 'Tristán', 'Ulises', 'Urbano', 'Valentín', 'Valerio', + 'Valero', 'Vasco', 'Venceslás', 'Vicente', 'Victor', + 'Victor Manuel', 'Victoriano', 'Victorino', 'Vidal', 'Vinicio', + 'Virgilio', 'Vito', 'Víctor', 'Wilfredo', 'Wálter', 'Xavier', + 'Yago', 'Zacarías', 'Álvaro', 'Ángel', 'Édgar', 'Íñigo', 'Óscar', - 'Juan Manuel', - 'Santiago', - 'Eduardo', - 'Victor', - 'Roberto', - 'Jaime', - 'Francisco Jose', - 'Ignacio', - 'Mario', - 'Alfonso', - 'Salvador', - 'Ricardo', - 'Jordi', - 'Marcos', - 'Emilio', - 'Julian', - 'Julio', - 'Guillermo', - 'Tomás', - 'Gabriel', - 'Agustín', - 'Jose Miguel', - 'Felix', - 'Jose Ramon', - 'Gonzalo', - 'Marc', - 'Mohamed', - 'Joan', - 'Hugo', - 'Ismael', - 'Cristian', - 'Nicolás', - 'Mariano', - 'Josep', - 'Domingo', - 'Samuel', - 'Juan Francisco', - 'Alfredo', - 'Sebastian', - 'Aitor', - 'Jose Carlos', - 'Martin', - 'Felipe', - 'Cesar', - 'Hector', - 'Jose Angel', - 'Jose Ignacio', - 'Victor Manuel', - 'Gregorio', - 'Luis Miguel', - 'Iker', - 'Jose Francisco', - 'Juan Luis', - 'Albert', - 'Lorenzo', - 'Alex', - 'Xavier', - 'Rodrigo') + ) + # 477 female first names, alphabetically. + # Source: Álvaro Mondéjar Rubio <[email protected]> first_names_female = ( - 'María', - 'Carmen', - 'Ana', - 'Isabel', - 'Dolores', - 'Pilar', - 'Josefa', - 'Teresa', - 'Rosa', - 'Cristina', - 'Ángeles', - 'Antonia', - 'Laura', - 'Francisca', - 'Elena', - 'Mercedes', - 'Luisa', - 'Marta', - 'Concepción', - 'Rosario', - 'Lucía', - 'Juana', - 'Manuela', - 'Sara', - 'Paula', - 'Raquel', - 'Beatriz', - 'Eva', - 'Patricia', - 'Victoria', - 'Rocio', - 'Encarnacion', - 'Julia', - 'Belen', - 'Silvia', - 'Esther', - 'Andrea', - 'Montserrat', - 'Nuria', - 'Angela', - 'Irene', - 'Inmaculada', - 'Mónica', - 'Sandra', - 'Margarita', - 'Yolanda', - 'Alba', - 'Sonia', - 'Alicia', - 'Mar', - 'Susana', - 'Marina', - 'Amparo', - 'Natalia', - 'Nieves', - 'Gloria', - 'Claudia', - 'Soledad', - 'Ines', - 'Lourdes', - 'Verónica', - 'Carolina', - 'Luz', - 'Consuelo', - 'Noelia', - 'Asunción', - 'Lorena', - 'Sofia', - 'Milagros', - 'Catalina', - 'Esperanza', - 'Olga', - 'Alejandra', - 'Carla', - 'Emilia', - 'Fátima', - 'Aurora', - 'Blanca', - 'Magdalena', - 'Miriam', - 'Lidia', - 'Nerea', - 'Clara', - 'Daniela', - 'Anna', - 'Celia', - 'Elisa', - 'Eugenia', - 'Josefina', - 'Virginia', - 'Purificación', - 'Vanesa', - 'Remedios', - 'Trinidad', - 'Gema', - 'Adriana', - 'Vicenta', - 'Mireia', - 'Begoña') + 'Abigaíl', 'Abril', 'Adela', 'Adelaida', 'Adelia', + 'Adelina', 'Adora', 'Adoración', 'Adriana', 'Agustina', 'Ainara', + 'Ainoa', 'Aitana', 'Alba', 'Albina', 'Ale', 'Alejandra', + 'Alexandra', 'Alicia', 'Alma', 'Almudena', 'Alondra', 'Amada', + 'Amalia', 'Amanda', 'Amarilis', 'Amaya', 'Amelia', 'Amor', + 'Amparo', 'América', 'Ana', 'Ana Belén', 'Ana Sofía', 'Anabel', + 'Anastasia', 'Andrea', 'Angelina', 'Angelita', 'Angélica', 'Ani', + 'Anita', 'Anna', 'Anselma', 'Antonia', 'Anunciación', + 'Apolonia', 'Araceli', 'Arcelia', 'Ariadna', 'Ariel', 'Armida', + 'Aroa', 'Aránzazu', 'Ascensión', 'Asunción', 'Aura', + 'Aurelia', 'Aurora', 'Azahar', 'Azahara', 'Azeneth', 'Azucena', + 'Beatriz', 'Begoña', 'Belen', 'Belén', 'Benigna', 'Benita', + 'Bernarda', 'Bernardita', 'Berta', 'Bibiana', 'Bienvenida', + 'Blanca', 'Brunilda', 'Brígida', 'Bárbara', 'Calista', + 'Calixta', 'Camila', 'Candela', 'Candelaria', 'Candelas', + 'Caridad', 'Carina', 'Carla', 'Carlota', 'Carmela', 'Carmelita', + 'Carmen', 'Carmina', 'Carolina', 'Casandra', 'Catalina', + 'Cayetana', 'Cecilia', 'Celestina', 'Celia', 'Charo', 'Chelo', + 'Chita', 'Chus', 'Cintia', 'Clara', 'Clarisa', 'Claudia', + 'Clementina', 'Cloe', 'Clotilde', 'Concepción', 'Concha', + 'Constanza', 'Consuela', 'Consuelo', 'Coral', 'Corona', + 'Crescencia', 'Cristina', 'Cruz', 'Custodia', 'Cándida', 'Dafne', + 'Dalila', 'Daniela', 'Delfina', 'Delia', 'Diana', 'Dionisia', + 'Dolores', 'Dominga', 'Domitila', 'Dora', 'Dorita', 'Dorotea', + 'Dulce', 'Débora', 'Edelmira', 'Elba', 'Elena', 'Eli', 'Eliana', + 'Eligia', 'Elisa', 'Elisabet', 'Elodia', 'Eloísa', 'Elvira', + 'Ema', 'Emelina', 'Emilia', 'Emiliana', 'Emma', 'Emperatriz', + 'Encarna', 'Encarnacion', 'Encarnación', 'Encarnita', + 'Esmeralda', 'Esperanza', 'Estefanía', 'Estela', 'Ester', 'Esther', + 'Estrella', 'Etelvina', 'Eufemia', 'Eugenia', 'Eulalia', + 'Eusebia', 'Eva', 'Eva María', 'Evangelina', 'Evelia', 'Evita', + 'Fabiana', 'Fabiola', 'Fanny', 'Febe', 'Felicia', 'Feliciana', + 'Felicidad', 'Felipa', 'Felisa', 'Fernanda', 'Fidela', 'Filomena', + 'Flavia', 'Flor', 'Flora', 'Florencia', 'Florentina', 'Florina', + 'Florinda', 'Fortunata', 'Francisca', 'Fátima', 'Gabriela', + 'Gala', 'Gema', 'Genoveva', 'Georgina', 'Gertrudis', 'Gisela', + 'Gloria', 'Gracia', 'Graciana', 'Graciela', 'Griselda', + 'Guadalupe', 'Guiomar', 'Haydée', 'Herminia', 'Hilda', 'Hortensia', + 'Ignacia', 'Ileana', 'Imelda', 'Inmaculada', 'Inés', 'Irene', + 'Iris', 'Irma', 'Isa', 'Isabel', 'Isabela', 'Isaura', + 'Isidora', 'Itziar', 'Jacinta', 'Javiera', 'Jennifer', 'Jenny', + 'Jessica', 'Jesusa', 'Jimena', 'Joaquina', 'Jordana', 'Josefa', + 'Josefina', 'José', 'Jovita', 'Juana', 'Juanita', 'Judith', + 'Julia', 'Juliana', 'Julie', 'Julieta', 'Lara', 'Laura', + 'Leandra', 'Leire', 'Leocadia', 'Leonor', 'Leticia', 'Leyre', + 'Lidia', 'Ligia', 'Lilia', 'Liliana', 'Lina', 'Loida', 'Lola', + 'Lorena', 'Lorenza', 'Loreto', 'Lourdes', 'Luciana', 'Lucila', + 'Lucía', 'Luisa', 'Luisina', 'Luna', 'Lupe', 'Lupita', 'Luz', + 'Macarena', 'Macaria', 'Magdalena', 'Maite', 'Malena', 'Mamen', + 'Manola', 'Manu', 'Manuela', 'Manuelita', 'Mar', 'Marcela', + 'Marcia', 'Margarita', 'Mariana', 'Marianela', 'Maribel', + 'Maricela', 'Maricruz', 'Marina', 'Marisa', 'Marisela', 'Marisol', + 'Maristela', 'Marita', 'Marta', 'Martina', 'Martirio', 'María', + 'María Belén', 'María Carmen', 'María Cristina', + 'María Del Carmen', 'María Dolores', 'María Fernanda', 'María Jesús', + 'María José', 'María Luisa', 'María Manuela', 'María Pilar', + 'María Teresa', 'María Ángeles', 'Matilde', 'Maura', 'Maxi', 'Mayte', + 'Melania', 'Melisa', 'Mercedes', 'Merche', 'Micaela', 'Miguela', + 'Milagros', 'Mireia', 'Miriam', 'Mirta', 'Modesta', 'Montserrat', + 'Morena', 'Máxima', 'Mónica', 'Nadia', 'Narcisa', 'Natalia', + 'Natividad', 'Nayara', 'Nazaret', 'Nerea', 'Nereida', 'Nicolasa', + 'Nidia', 'Nieves', 'Nilda', 'Noa', 'Noelia', 'Noemí', 'Nuria', + 'Nydia', 'Nélida', 'Obdulia', 'Octavia', 'Odalis', 'Odalys', + 'Ofelia', 'Olalla', 'Olga', 'Olimpia', 'Olivia', 'Oriana', + 'Otilia', 'Paca', 'Pacífica', 'Palmira', 'Paloma', 'Paola', + 'Pascuala', 'Pastora', 'Patricia', 'Paula', 'Paulina', 'Paz', + 'Pepita', 'Perla', 'Perlita', 'Petrona', 'Piedad', 'Pilar', + 'Pili', 'Primitiva', 'Priscila', 'Prudencia', 'Purificación', + 'Pía', 'Rafaela', 'Ramona', 'Raquel', 'Rebeca', 'Regina', + 'Reina', 'Remedios', 'Renata', 'Reyes', 'Reyna', 'Ricarda', + 'Rita', 'Roberta', 'Rocío', 'Rosa', 'Rosa María', 'Rosalina', + 'Rosalinda', 'Rosalva', 'Rosalía', 'Rosario', 'Rosaura', 'Rosenda', + 'Roxana', 'Rufina', 'Ruperta', 'Ruth', 'Sabina', 'Salomé', + 'Salud', 'Samanta', 'Sandra', 'Sara', 'Sarita', 'Saturnina', + 'Selena', 'Serafina', 'Silvia', 'Socorro', 'Sofía', 'Sol', + 'Soledad', 'Sonia', 'Soraya', 'Susana', 'Susanita', 'Tamara', + 'Tania', 'Tatiana', 'Tecla', 'Teodora', 'Tere', 'Teresa', + 'Teresita', 'Teófila', 'Tomasa', 'Trini', 'Trinidad', 'Valentina', + 'Valeria', 'Vanesa', 'Vera', 'Verónica', 'Vicenta', 'Victoria', + 'Vilma', 'Violeta', 'Virginia', 'Visitación', 'Viviana', + 'Ximena', 'Xiomara', 'Yaiza', 'Yolanda', 'Yésica', 'Yéssica', + 'Zaida', 'Zaira', 'Zoraida', 'África', 'Ágata', 'Águeda', + 'Ámbar', 'Ángela', 'Ángeles', 'Áurea', 'Íngrid', 'Úrsula', + ) first_names = first_names_male + first_names_female diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/faker/providers/phone_number/es_ES/__init__.py new/Faker-4.1.0/faker/providers/phone_number/es_ES/__init__.py --- old/Faker-4.0.3/faker/providers/phone_number/es_ES/__init__.py 2020-01-14 19:13:54.000000000 +0100 +++ new/Faker-4.1.0/faker/providers/phone_number/es_ES/__init__.py 2020-05-12 17:20:18.000000000 +0200 @@ -2,11 +2,57 @@ class Provider(PhoneNumberProvider): + """ + According to official specs: + https://avancedigital.gob.es/es-ES/Servicios/Numeracion/Documents/Descripcion_PNN.pdf + """ formats = ( - '+34 ### ### ###', - '+34 #########', - '+34 ### ## ## ##', - '+34### ### ###', - '+34#########', - '+34### ## ## ##', + '+34 9## ### ###', + '+34 8## ### ###', + '+34 70# ### ###', + '+34 71# ### ###', + '+34 72# ### ###', + '+34 73# ### ###', + '+34 74# ### ###', + '+34 6## ### ###', + '+34 9########', + '+34 8########', + '+34 70#######', + '+34 71#######', + '+34 72#######', + '+34 73#######', + '+34 74#######', + '+34 6########', + '+34 9## ## ## ##', + '+34 8## ## ## ##', + '+34 70# ## ## ##', + '+34 71# ## ## ##', + '+34 72# ## ## ##', + '+34 73# ## ## ##', + '+34 74# ## ## ##', + '+34 6## ## ## ##', + '+349## ### ###', + '+348## ### ###', + '+3470# ### ###', + '+3471# ### ###', + '+3472# ### ###', + '+3473# ### ###', + '+3474# ### ###', + '+346## ### ###', + '+349########', + '+348########', + '+3470#######', + '+3471#######', + '+3472#######', + '+3473#######', + '+3474#######', + '+346########', + '+349## ## ## ##', + '+348## ## ## ##', + '+3470# ## ## ##', + '+3471# ## ## ##', + '+3472# ## ## ##', + '+3473# ## ## ##', + '+3474# ## ## ##', + '+346## ## ## ##', ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/faker/providers/ssn/sk_SK/__init__.py new/Faker-4.1.0/faker/providers/ssn/sk_SK/__init__.py --- old/Faker-4.0.3/faker/providers/ssn/sk_SK/__init__.py 2020-01-14 19:13:54.000000000 +0100 +++ new/Faker-4.1.0/faker/providers/ssn/sk_SK/__init__.py 2020-05-12 17:20:18.000000000 +0200 @@ -1,3 +1,5 @@ +from math import ceil + from .. import Provider as BaseProvider @@ -10,6 +12,8 @@ 'SK##########', ) + national_id_months = ['%.2d' % i for i in range(1, 13)] + ['%.2d' % i for i in range(51, 63)] + def vat_id(self): """ http://ec.europa.eu/taxation_customs/vies/faq.html#item_11 @@ -17,3 +21,24 @@ """ return self.bothify(self.random_element(self.vat_id_formats)) + + def birth_number(self): + """ + Birth Number (Czech/Slovak: rodné číslo (RČ)) + https://en.wikipedia.org/wiki/National_identification_number#Czech_Republic_and_Slovakia + """ + birthdate = self.generator.date_of_birth() + year = '%.2d' % (birthdate.year % 100) + month = self.random_element(self.national_id_months) + day = '%.2d' % birthdate.day + if birthdate.year > 1953: + sn = self.random_number(4, True) + else: + sn = self.random_number(3, True) + number = int('{}{}{}{}'.format(year, month, day, sn)) + birth_number = str(ceil(number / 11) * 11) + if year == '00': + birth_number = '00' + birth_number + elif year[0] == '0': + birth_number = '0' + birth_number + return '{}/{}'.format(birth_number[:6], birth_number[6::]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/faker/proxy.py new/Faker-4.1.0/faker/proxy.py --- old/Faker-4.0.3/faker/proxy.py 2020-04-13 21:24:31.000000000 +0200 +++ new/Faker-4.1.0/faker/proxy.py 2020-05-12 17:20:18.000000000 +0200 @@ -30,10 +30,10 @@ # This guarantees a FIFO ordering of elements in `locales` based on the final # locale string while discarding duplicates after processing elif isinstance(locale, (list, tuple, set)): - assert all(isinstance(l, str) for l in locale) + assert all(isinstance(local_code, str) for local_code in locale) locales = [] - for l in locale: - final_locale = l.replace('-', '_') + for code in locale: + final_locale = code.replace('-', '_') if final_locale not in locales: locales.append(final_locale) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/setup.py new/Faker-4.1.0/setup.py --- old/Faker-4.0.3/setup.py 2020-04-13 21:24:31.000000000 +0200 +++ new/Faker-4.1.0/setup.py 2020-05-12 17:20:18.000000000 +0200 @@ -33,6 +33,7 @@ long_description=README, entry_points={ 'console_scripts': ['faker=faker.cli:execute_from_command_line'], + 'pytest11': ['faker = faker.contrib.pytest.plugin'], }, classifiers=[ # See https://pypi.org/pypi?%3Aaction=list_classifiers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/providers/test_barcode.py new/Faker-4.1.0/tests/providers/test_barcode.py --- old/Faker-4.0.3/tests/providers/test_barcode.py 2020-01-14 19:13:54.000000000 +0100 +++ new/Faker-4.1.0/tests/providers/test_barcode.py 2020-05-12 17:20:18.000000000 +0200 @@ -30,7 +30,7 @@ assert (sum(ean13_digits) + 2 * sum(ean13_digits[1::2])) % 10 == 0 def test_ean_bad_length(self): - bad_lengths = [l for l in range(1, 15) if l not in (8, 13)] + bad_lengths = [size for size in range(1, 15) if size not in (8, 13)] for length in bad_lengths: with self.assertRaises(AssertionError): self.fake.ean(length) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/providers/test_date_time.py new/Faker-4.1.0/tests/providers/test_date_time.py --- old/Faker-4.0.3/tests/providers/test_date_time.py 2020-03-13 15:54:54.000000000 +0100 +++ new/Faker-4.1.0/tests/providers/test_date_time.py 2020-05-12 17:20:18.000000000 +0200 @@ -18,6 +18,7 @@ from faker.providers.date_time import change_year from faker.providers.date_time.ar_AA import Provider as ArProvider from faker.providers.date_time.ar_EG import Provider as EgProvider +from faker.providers.date_time.de_DE import Provider as DeDeProvider from faker.providers.date_time.hy_AM import Provider as HyAmProvider from faker.providers.date_time.pl_PL import Provider as PlProvider from faker.providers.date_time.ru_RU import Provider as RuProvider @@ -518,6 +519,21 @@ change_year(today, -today.year) +class TestDeDe(unittest.TestCase): + + def setUp(self): + self.fake = Faker('de_DE') + Faker.seed(0) + + def test_day(self): + day = self.fake.day_of_week() + assert day in DeDeProvider.DAY_NAMES.values() + + def test_month(self): + month = self.fake.month_name() + assert month in DeDeProvider.MONTH_NAMES.values() + + class TestPlPL(unittest.TestCase): def setUp(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/providers/test_misc.py new/Faker-4.1.0/tests/providers/test_misc.py --- old/Faker-4.0.3/tests/providers/test_misc.py 2020-01-14 19:13:54.000000000 +0100 +++ new/Faker-4.1.0/tests/providers/test_misc.py 2020-05-12 17:20:18.000000000 +0200 @@ -17,7 +17,7 @@ self.fake = Faker() Faker.seed(0) - def test_uuid4(self): + def test_uuid4_str(self): uuid4 = self.fake.uuid4() assert uuid4 assert isinstance(uuid4, str) @@ -28,7 +28,7 @@ assert isinstance(uuid4, int) def test_uuid4_uuid_object(self): - uuid4 = self.fake.uuid4(cast_to=lambda x: x) + uuid4 = self.fake.uuid4(cast_to=None) assert uuid4 assert isinstance(uuid4, uuid.UUID) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/providers/test_phone_number.py new/Faker-4.1.0/tests/providers/test_phone_number.py --- old/Faker-4.0.3/tests/providers/test_phone_number.py 2020-03-26 15:13:27.000000000 +0100 +++ new/Faker-4.1.0/tests/providers/test_phone_number.py 2020-05-12 17:20:18.000000000 +0200 @@ -267,3 +267,14 @@ def test_phone_number(self): phone_number = self.fake.phone_number() re.match(r"^(\+91[\-\s]?)?[0]?(91)?[789]\d{9}$", phone_number) + + +class TestEs_ES(unittest.TestCase): + + def setUp(self): + self.fake = Faker('es_ES') + Faker.seed(0) + + def test_phone_number(self): + phone_number = self.fake.phone_number() + re.match(r"(\+34)?((6([0-9]*){8})|(7[1-4]+([0-9]*){7})|((8|9)[1-9]+([0-9]*){7}))$", phone_number) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/providers/test_ssn.py new/Faker-4.1.0/tests/providers/test_ssn.py --- old/Faker-4.0.3/tests/providers/test_ssn.py 2020-03-26 15:13:27.000000000 +0100 +++ new/Faker-4.1.0/tests/providers/test_ssn.py 2020-05-12 17:20:18.000000000 +0200 @@ -162,6 +162,23 @@ assert int(birth_number.replace("/", "")) % 11 == 0 +class TestSkSK(unittest.TestCase): + def setUp(self): + self.fake = Faker('sk_SK') + Faker.seed(0) + + def test_vat_id(self): + for _ in range(100): + assert re.search(r'^SK\d{10}$', self.fake.vat_id()) + + def test_birth_number(self): + for _ in range(100): + birth_number = self.fake.birth_number() + assert len(birth_number) in [10, 11] + assert birth_number[6] == "/" + assert int(birth_number.replace("/", "")) % 11 == 0 + + class TestDeAT(unittest.TestCase): def setUp(self): self.fake = Faker('de_AT') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/session_overrides/conftest.py new/Faker-4.1.0/tests/pytest/session_overrides/conftest.py --- old/Faker-4.0.3/tests/pytest/session_overrides/conftest.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/session_overrides/conftest.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,26 @@ +import os + +import pytest + +EXCLUSIVE_SESSION_FLAG = '--exclusive-faker-session' +SKIP_REASON = ( + '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 "{flag}" flag specified.' +).format(flag=EXCLUSIVE_SESSION_FLAG) + + +def pytest_addoption(parser): + parser.addoption( + EXCLUSIVE_SESSION_FLAG, action='store_true', default=False, + help='Allows tests that require an exclusive session to run', + ) + + +def pytest_collection_modifyitems(config, items): + if config.getoption(EXCLUSIVE_SESSION_FLAG): + return + skip_lacks_exclusive_session = pytest.mark.skip(reason=SKIP_REASON) + session_overrides_dir = os.path.abspath(os.path.join(__file__, '..')) + for item in items: + if str(item.fspath).startswith(session_overrides_dir): + item.add_marker(skip_lacks_exclusive_session) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/__init__.py new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/__init__.py --- old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/__init__.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1 @@ +_MODULE_LOCALES = ['en_GB'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/conftest.py new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/conftest.py --- old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/conftest.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/conftest.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,8 @@ +import pytest + +from tests.pytest.session_overrides.session_locale import _MODULE_LOCALES + + [email protected](scope='session', autouse=True) +def faker_session_locale(): + return _MODULE_LOCALES diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/test_autouse_faker_locale.py new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/test_autouse_faker_locale.py --- old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/test_autouse_faker_locale.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/test_autouse_faker_locale.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,43 @@ +"""TEST NOTES: + +The following tests cover cases where a ``faker_session_locale`` fixture was defined +by the user as well as a user-defined ``faker_locale`` autouse fixture. In this setup, +the value of ``faker_session_locale`` will be ignored, since the plugin's session level +``Faker`` instance will not be used. Each test will instead generate a new instance using +the value of ``faker_locale``. These new instances will be still seeded in accordance to +the plugin's seeding rules. +""" + +from random import Random + +import pytest + +from faker.contrib.pytest.plugin import DEFAULT_SEED + +_CHANGED_LOCALE = ['it_IT'] + + [email protected](autouse=True) +def faker_locale(): + return _CHANGED_LOCALE + + [email protected]() +def faker_seed(): + return 4761 + + +def test_no_injection(_session_faker, faker): + random = Random(DEFAULT_SEED) + assert faker != _session_faker + assert faker.locales == _CHANGED_LOCALE + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_seed(_session_faker, faker, faker_seed): + random = Random(faker_seed) + assert faker != _session_faker + assert faker.locales == _CHANGED_LOCALE + assert faker.random != random + assert faker.random.getstate() == random.getstate() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/test_autouse_faker_seed.py new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/test_autouse_faker_seed.py --- old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/test_autouse_faker_seed.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/test_autouse_faker_seed.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,42 @@ +"""TEST NOTES: + +The following tests cover cases where a ``faker_session_locale`` fixture was defined +by the user as well as a user-defined ``faker_seed`` autouse fixture. In this setup, +the plugin's ``DEFAULT_SEED`` will be ignored, and ``Faker`` instances will be seeded +using the value of ``faker_seed``. Said instances are still chosen in accordance to +how ``faker_locale`` and ``faker_session_locale`` interact with each other. +""" + +from random import Random + +import pytest + +from tests.pytest.session_overrides.session_locale import _MODULE_LOCALES + +_CHANGED_SEED = 4761 + + [email protected]() +def faker_locale(): + return ['it_IT'] + + [email protected](autouse=True) +def faker_seed(): + return _CHANGED_SEED + + +def test_no_injection(_session_faker, faker): + random = Random(_CHANGED_SEED) + assert faker == _session_faker + assert faker.locales == _MODULE_LOCALES + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_locale(_session_faker, faker, faker_locale): + random = Random(_CHANGED_SEED) + assert faker != _session_faker + assert faker.locales == faker_locale + assert faker.random != random + assert faker.random.getstate() == random.getstate() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/test_manual_injection.py new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/test_manual_injection.py --- old/Faker-4.0.3/tests/pytest/session_overrides/session_locale/test_manual_injection.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/session_overrides/session_locale/test_manual_injection.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,56 @@ +"""TEST NOTES: + +The following tests cover cases where a ``faker_session_locale`` fixture was defined +by the user as well as non-autouse ``faker_locale`` and ``faker_seed`` fixtures. The +resulting behavior of the ``faker`` fixture will vary dependening on which fixtures +are injected. +""" + +from random import Random + +import pytest + +from faker.contrib.pytest.plugin import DEFAULT_SEED +from tests.pytest.session_overrides.session_locale import _MODULE_LOCALES + + [email protected]() +def faker_locale(): + return ['it_IT'] + + [email protected]() +def faker_seed(): + return 4761 + + +def test_no_injection(_session_faker, faker): + random = Random(DEFAULT_SEED) + assert faker == _session_faker + assert faker.locales == _MODULE_LOCALES + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_locale(_session_faker, faker, faker_locale): + random = Random(DEFAULT_SEED) + assert faker != _session_faker + assert faker.locales == faker_locale + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_seed(_session_faker, faker, faker_seed): + random = Random(faker_seed) + assert faker == _session_faker + assert faker.locales == _MODULE_LOCALES + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_seed_and_locale(_session_faker, faker, faker_locale, faker_seed): + random = Random(faker_seed) + assert faker != _session_faker + assert faker.locales == faker_locale + assert faker.random != random + assert faker.random.getstate() == random.getstate() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/test_autouse_faker_locale.py new/Faker-4.1.0/tests/pytest/test_autouse_faker_locale.py --- old/Faker-4.0.3/tests/pytest/test_autouse_faker_locale.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/test_autouse_faker_locale.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,43 @@ +"""TEST NOTES: + +The following tests cover cases where a ``faker_session_locale`` fixture was not +defined by the user, but an autouse ``faker_locale`` fixture was defined. In this +setup, the plugin's session level ``Faker`` instance will not be used, and each +test will instead generate a new instance using the value of ``faker_locale``. +These new instances will be still seeded in accordance to the plugin's seeding +rules. +""" + +from random import Random + +import pytest + +from faker.contrib.pytest.plugin import DEFAULT_SEED + +_CHANGED_LOCALE = ['it_IT'] + + [email protected](autouse=True) +def faker_locale(): + return _CHANGED_LOCALE + + [email protected]() +def faker_seed(): + return 4761 + + +def test_no_injection(_session_faker, faker): + random = Random(DEFAULT_SEED) + assert faker != _session_faker + assert faker.locales == _CHANGED_LOCALE + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_seed(_session_faker, faker, faker_seed): + random = Random(faker_seed) + assert faker != _session_faker + assert faker.locales == _CHANGED_LOCALE + assert faker.random != random + assert faker.random.getstate() == random.getstate() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/test_autouse_faker_seed.py new/Faker-4.1.0/tests/pytest/test_autouse_faker_seed.py --- old/Faker-4.0.3/tests/pytest/test_autouse_faker_seed.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/test_autouse_faker_seed.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,43 @@ +"""TEST NOTES: + +The following tests cover cases where a ``faker_session_locale`` fixture was not +defined by the user, but an autouse ``faker_seed`` fixture was defined. In this +setup, the plugin's ``DEFAULT_SEED`` will be ignored, and ``Faker`` instances will +be seeded using the value of ``faker_seed``. Said instances are still chosen in +accordance to how ``faker_locale`` and ``faker_session_locale`` interact with +each other. +""" + +from random import Random + +import pytest + +from faker.contrib.pytest.plugin import DEFAULT_LOCALE + +_CHANGED_SEED = 4761 + + [email protected]() +def faker_locale(): + return ['it_IT'] + + [email protected](autouse=True) +def faker_seed(): + return _CHANGED_SEED + + +def test_no_injection(_session_faker, faker): + random = Random(_CHANGED_SEED) + assert faker == _session_faker + assert faker.locales == [DEFAULT_LOCALE] + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_locale(_session_faker, faker, faker_locale): + random = Random(_CHANGED_SEED) + assert faker != _session_faker + assert faker.locales == faker_locale + assert faker.random != random + assert faker.random.getstate() == random.getstate() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/pytest/test_manual_injection.py new/Faker-4.1.0/tests/pytest/test_manual_injection.py --- old/Faker-4.0.3/tests/pytest/test_manual_injection.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Faker-4.1.0/tests/pytest/test_manual_injection.py 2020-05-12 17:20:18.000000000 +0200 @@ -0,0 +1,56 @@ +"""TEST NOTES: + +The following tests cover cases where a ``faker_session_locale`` fixture was not +defined by the user, but non-autouse ``faker_locale`` and ``faker_seed`` fixtures +were defined. The resulting behavior of the ``faker`` fixture will vary dependening +on which fixtures are injected. +""" + + +from random import Random + +import pytest + +from faker.contrib.pytest.plugin import DEFAULT_LOCALE, DEFAULT_SEED + + [email protected]() +def faker_locale(): + return ['it_IT'] + + [email protected]() +def faker_seed(): + return 4761 + + +def test_no_injection(_session_faker, faker): + random = Random(DEFAULT_SEED) + assert faker == _session_faker + assert faker.locales == [DEFAULT_LOCALE] + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_locale(_session_faker, faker, faker_locale): + random = Random(DEFAULT_SEED) + assert faker != _session_faker + assert faker.locales == faker_locale + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_seed(_session_faker, faker, faker_seed): + random = Random(faker_seed) + assert faker == _session_faker + assert faker.locales == [DEFAULT_LOCALE] + assert faker.random != random + assert faker.random.getstate() == random.getstate() + + +def test_inject_faker_seed_and_locale(_session_faker, faker, faker_locale, faker_seed): + random = Random(faker_seed) + assert faker != _session_faker + assert faker.locales == faker_locale + assert faker.random != random + assert faker.random.getstate() == random.getstate() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-4.0.3/tests/test_proxy.py new/Faker-4.1.0/tests/test_proxy.py --- old/Faker-4.0.3/tests/test_proxy.py 2020-04-13 21:24:31.000000000 +0200 +++ new/Faker-4.1.0/tests/test_proxy.py 2020-05-12 17:20:18.000000000 +0200 @@ -69,7 +69,7 @@ def test_items(self): locale = ['de_DE', 'en-US', 'en-PH', 'ja_JP', 'de-DE', 'ja-JP', 'en-US'] - processed_locale = list({l.replace('-', '_') for l in locale}) + processed_locale = list({code.replace('-', '_') for code in locale}) self.fake = Faker(locale) for locale_name, factory in self.fake.items(): assert locale_name in processed_locale @@ -79,8 +79,8 @@ locale = ['de_DE', 'en-US', 'en-PH', 'ja_JP'] self.fake = Faker(locale) - for l in locale: - assert isinstance(self.fake[l], Generator) + for code in locale: + assert isinstance(self.fake[code], Generator) with self.assertRaises(KeyError): self.fake['en_GB']
