+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-flask-babel-4.0.0-4.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-flask-babel-4.0.0-4.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.2.1, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/flask-babel-4.0.0
configfile: pyproject.toml
plugins: time-machine-2.14.1, datadir-1.5.0, regressions-2.5.0, timeout-2.3.1, mock-3.14.0
collected 31 items
tests/test_app_factory.py . [ 3%]
tests/test_date_formatting.py FFFF [ 16%]
tests/test_force_locale.py .... [ 29%]
tests/test_gettext.py ............. [ 70%]
tests/test_integration.py ....... [ 93%]
tests/test_multiple_apps.py . [ 96%]
tests/test_number_formatting.py . [100%]
========================================================================================= FAILURES ==========================================================================================
________________________________________________________________________________________ test_basics ________________________________________________________________________________________
def test_basics():
app = flask.Flask(__name__)
babel.Babel(app)
d = datetime(2010, 4, 12, 13, 46)
delta = timedelta(days=6)
with app.test_request_context():
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00\u202fPM'
assert babel.format_date(d) == 'Apr 12, 2010'
assert babel.format_time(d) == '1:46:00\u202fPM'
assert babel.format_timedelta(delta) == '1 week'
assert babel.format_timedelta(delta, threshold=1) == '6 days'
with app.test_request_context():
get_babel(app).default_timezone = 'Europe/Vienna'
> assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00\u202fPM'
E AssertionError: assert 'Apr 12, 2010...46:00\u202fPM' == 'Apr 12, 2010...46:00\u202fPM'
E
E - Apr 12, 2010, 3:46:00 PM
E ? ^
E + Apr 12, 2010, 1:46:00 PM
E ? ^
tests/test_date_formatting.py:24: AssertionError
____________________________________________________________________________________ test_custom_formats ____________________________________________________________________________________
def test_custom_formats():
app = flask.Flask(__name__)
app.config.update(
BABEL_DEFAULT_LOCALE='en_US',
BABEL_DEFAULT_TIMEZONE='Pacific/Johnston'
)
b = babel.Babel(app)
b.date_formats['datetime'] = 'long'
b.date_formats['datetime.long'] = 'MMMM d, yyyy h:mm:ss a'
d = datetime(2010, 4, 12, 13, 46)
with app.test_request_context():
> assert babel.format_datetime(d) == 'April 12, 2010 3:46:00 AM'
E AssertionError: assert 'April 12, 2010 1:46:00 PM' == 'April 12, 2010 3:46:00 AM'
E
E - April 12, 2010 3:46:00 AM
E ? ^ ^
E + April 12, 2010 1:46:00 PM
E ? ^ ^
tests/test_date_formatting.py:46: AssertionError
________________________________________________________________________________ test_custom_locale_selector ________________________________________________________________________________
def test_custom_locale_selector():
app = flask.Flask(__name__)
b = babel.Babel(app)
d = datetime(2010, 4, 12, 13, 46)
the_timezone = 'UTC'
the_locale = 'en_US'
def select_locale():
return the_locale
def select_timezone():
return the_timezone
get_babel(app).locale_selector = select_locale
get_babel(app).timezone_selector = select_timezone
with app.test_request_context():
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00\u202fPM'
the_locale = 'de_DE'
the_timezone = 'Europe/Vienna'
with app.test_request_context():
> assert babel.format_datetime(d) == '12.04.2010, 15:46:00'
E AssertionError: assert '12.04.2010, 13:46:00' == '12.04.2010, 15:46:00'
E
E - 12.04.2010, 15:46:00
E ? ^
E + 12.04.2010, 13:46:00
E ? ^
tests/test_date_formatting.py:73: AssertionError
______________________________________________________________________________________ test_refreshing ______________________________________________________________________________________
def test_refreshing():
app = flask.Flask(__name__)
babel.Babel(app)
d = datetime(2010, 4, 12, 13, 46)
with app.test_request_context():
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00\u202fPM'
get_babel(app).default_timezone = 'Europe/Vienna'
babel.refresh()
> assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00\u202fPM'
E AssertionError: assert 'Apr 12, 2010...46:00\u202fPM' == 'Apr 12, 2010...46:00\u202fPM'
E
E - Apr 12, 2010, 3:46:00 PM
E ? ^
E + Apr 12, 2010, 1:46:00 PM
E ? ^
tests/test_date_formatting.py:84: AssertionError
================================================================================== short test summary info ==================================================================================
FAILED tests/test_date_formatting.py::test_basics - AssertionError: assert 'Apr 12, 2010...46:00\u202fPM' == 'Apr 12, 2010...46:00\u202fPM'
FAILED tests/test_date_formatting.py::test_custom_formats - AssertionError: assert 'April 12, 2010 1:46:00 PM' == 'April 12, 2010 3:46:00 AM'
FAILED tests/test_date_formatting.py::test_custom_locale_selector - AssertionError: assert '12.04.2010, 13:46:00' == '12.04.2010, 15:46:00'
FAILED tests/test_date_formatting.py::test_refreshing - AssertionError: assert 'Apr 12, 2010...46:00\u202fPM' == 'Apr 12, 2010...46:00\u202fPM'
=============================================================================== 4 failed, 27 passed in 0.46s ================================================================================
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-isolationbuildwith--no-isolationI'm using during all processes only locally installed modulesinstallermodulecut off from access to the public network(pytest is executed with-m "not network")Here is pytest output:
List of installed modules in build env:
Please let me know if you need more details or want me to perform some diagnostics.