You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
==================================FAILURES===================================_____________test_patched_db_session_default_duration_threshold______________tmp_path=WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/test_patched_db_session_defaul0')
deftest_patched_db_session_default_duration_threshold(tmp_path):
# The test checks that db_session uses the current dynamic value of SLOW_DB_SESSION_DURATION_THRESHOLD# if no duration_threshold was explicitly specified for db_sessionwithpatch('pony.orm.dbproviders.sqlite.provider_cls', pony_utils.PatchedSQLiteProvider):
db=pony_utils.TrackedDatabase()
db.bind('sqlite', str(tmp_path/'db.sqlite'), create_db=True)
classEntity1(db.Entity):
a=Required(int)
db.generate_mapping(create_tables=True)
# We change the value of SLOW_DB_SESSION_DURATION_THRESHOLD, and the current value should be used by db_sessionwithpatch('tribler.core.utilities.pony_utils.SLOW_DB_SESSION_DURATION_THRESHOLD', 0.0):
withpatch.object(pony_utils.TriblerDbSession, '_format_warning',
return_value='<warning text>') asformat_warning_mock:
perform_queries(db, Entity1)
>format_warning_mock.assert_called()
Entity1=<class'tribler.core.utilities.tests.test_pony_utils.test_patched_db_session_default_duration_threshold.<locals>.Entity1'>db=<tribler.core.utilities.pony_utils.TrackedDatabaseobjectat0x000001681A33EF40>format_warning_mock=<MagicMockname='_format_warning'id='1546627798976'>tmp_path=WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/test_patched_db_session_defaul0')
src\tribler\core\utilities\tests\test_pony_utils.py:101:
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self=<MagicMockname='_format_warning'id='1546627798976'>defassert_called(self):
"""assert that the mock was called at least once """ifself.call_count==0:
msg= ("Expected '%s' to have been called."%
(self._mock_nameor'mock'))
>raiseAssertionError(msg)
EAssertionError: Expected'_format_warning'tohavebeencalled.
msg="Expected '_format_warning' to have been called."self=<MagicMockname='_format_warning'id='1546627798976'>C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\unittest\mock.py:882: AssertionError===========================shorttestsummaryinfo===========================FAILEDsrc/tribler/core/utilities/tests/test_pony_utils.py::test_patched_db_session_default_duration_threshold-AssertionError: Expected'_format_warning'tohavebeencalled.
=====1failed, 1322passed, 3skipped, 499warningsin346.12s (0:05:46) =====
The text was updated successfully, but these errors were encountered:
https://github.com/Tribler/tribler/actions/runs/6784825905/job/18441888974?pr=7667#step:6:2748 in #7667
The text was updated successfully, but these errors were encountered: