-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
18.7.0: pytest is failing #1971
Comments
After add that unit to --deselect list I have now errors + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-cherrypy-18.7.0-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-cherrypy-18.7.0-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -q -p no:randomly --deselect cherrypy/test/test_caching.py::CacheTest::test_antistampede
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0, configfile: pytest.ini, testpaths: cherrypy/test/
plugins: cov-3.0.0
collected 298 items / 1 deselected / 297 selected
cherrypy/test/test_auth_basic.py ..... [ 1%]
cherrypy/test/test_auth_digest.py ...... [ 3%]
cherrypy/test/test_bus.py ............ [ 7%]
cherrypy/test/test_caching.py ....... [ 10%]
cherrypy/test/test_config.py .......... [ 13%]
cherrypy/test/test_config_server.py ..... [ 15%]
cherrypy/test/test_conn.py ...................... [ 22%]
cherrypy/test/test_core.py .................... [ 29%]
cherrypy/test/test_dynamicobjectmapping.py .... [ 30%]
cherrypy/test/test_encoding.py ......Exception ignored in: <_io.FileIO name=16 mode='rb+' closefd=True>
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/_pytest/unraisableexception.py", line 59, in __exit__
del self.unraisable
ResourceWarning: unclosed file <_io.BufferedRandom name=16>
....... [ 35%]
cherrypy/test/test_etags.py .... [ 36%]
cherrypy/test/test_http.py .s..Exception ignored in: <socket.socket fd=14, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 35698), raddr=('127.0.0.1', 54583)>
Traceback (most recent call last):
File "/usr/lib64/python3.8/socket.py", line 740, in close
self._sock = None
ResourceWarning: unclosed <socket.socket fd=14, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 35698), raddr=('127.0.0.1', 54583)>
..... [ 39%]
cherrypy/test/test_httputil.py ......................... [ 47%]
cherrypy/test/test_iterator.py .. [ 48%]
cherrypy/test/test_json.py .... [ 49%]
cherrypy/test/test_logging.py ....... [ 52%]
cherrypy/test/test_mime.py ..... [ 53%]
cherrypy/test/test_misc_tools.py .......... [ 57%]
cherrypy/test/test_native.py . [ 57%]
cherrypy/test/test_objectmapping.py ......... [ 60%]
cherrypy/test/test_params.py .... [ 61%]
cherrypy/test/test_plugins.py . [ 62%]
cherrypy/test/test_proxy.py ... [ 63%]
cherrypy/test/test_refleaks.py .. [ 63%]
cherrypy/test/test_request_obj.py ................. [ 69%]
cherrypy/test/test_routes.py ss [ 70%]
cherrypy/test/test_session.py ..........EEEEE [ 75%]
cherrypy/test/test_sessionauthenticate.py .. [ 76%]
cherrypy/test/test_states.py .............. [ 80%]
cherrypy/test/test_static.py ....x........s.. [ 86%]
cherrypy/test/test_tools.py ............ [ 90%]
cherrypy/test/test_tutorials.py ........... [ 93%]
cherrypy/test/test_virtualhost.py ... [ 94%]
cherrypy/test/test_wsgi_ns.py .. [ 95%]
cherrypy/test/test_wsgi_unix_socket.py .... [ 96%]
cherrypy/test/test_wsgi_vhost.py .. [ 97%]
cherrypy/test/test_wsgiapps.py ..... [ 99%]
cherrypy/test/test_xmlrpc.py .. [100%]
================================================================================== ERRORS ==================================================================================
__________________________________________________________ ERROR at setup of MemcachedSessionTest.test_0_Session ___________________________________________________________
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 464
def test_0_Session(self):
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 419
@pytest.fixture(scope='session')
def memcached_instance(request, watcher_getter, memcached_server_present):
E fixture 'watcher_getter' not found
> available fixtures: _unittest_setUpClass_fixture_MemcachedSessionTest, _xunit_setup_class_fixture_MemcachedSessionTest, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, memcached_client_present, memcached_configured, memcached_instance, memcached_server_present, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.
/home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py:419
________________________________________________________ ERROR at setup of MemcachedSessionTest.test_1_Concurrency _________________________________________________________
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 494
def test_1_Concurrency(self):
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 419
@pytest.fixture(scope='session')
def memcached_instance(request, watcher_getter, memcached_server_present):
E fixture 'watcher_getter' not found
> available fixtures: _unittest_setUpClass_fixture_MemcachedSessionTest, _xunit_setup_class_fixture_MemcachedSessionTest, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, memcached_client_present, memcached_configured, memcached_instance, memcached_server_present, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.
/home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py:419
__________________________________________________________ ERROR at setup of MemcachedSessionTest.test_3_Redirect __________________________________________________________
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 530
def test_3_Redirect(self):
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 419
@pytest.fixture(scope='session')
def memcached_instance(request, watcher_getter, memcached_server_present):
E fixture 'watcher_getter' not found
> available fixtures: _unittest_setUpClass_fixture_MemcachedSessionTest, _xunit_setup_class_fixture_MemcachedSessionTest, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, memcached_client_present, memcached_configured, memcached_instance, memcached_server_present, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.
/home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py:419
________________________________________________________ ERROR at setup of MemcachedSessionTest.test_5_Error_paths _________________________________________________________
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 536
def test_5_Error_paths(self):
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 419
@pytest.fixture(scope='session')
def memcached_instance(request, watcher_getter, memcached_server_present):
E fixture 'watcher_getter' not found
> available fixtures: _unittest_setUpClass_fixture_MemcachedSessionTest, _xunit_setup_class_fixture_MemcachedSessionTest, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, memcached_client_present, memcached_configured, memcached_instance, memcached_server_present, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.
/home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py:419
______________________________________________________________ ERROR at setup of MemcachedSessionTest.test_gc ______________________________________________________________
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/helper.py, line 287
def test_gc(self):
file /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py, line 419
@pytest.fixture(scope='session')
def memcached_instance(request, watcher_getter, memcached_server_present):
E fixture 'watcher_getter' not found
> available fixtures: _unittest_setUpClass_fixture_MemcachedSessionTest, _xunit_setup_class_fixture_MemcachedSessionTest, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, memcached_client_present, memcached_configured, memcached_instance, memcached_server_present, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.
/home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/test/test_session.py:419
------------------------------------ generated xml file: /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/.test-results/pytest/results.xml ------------------------------------
=========================================================================== slowest 10 durations ===========================================================================
10.53s call cherrypy/test/test_http.py::HTTPTests::test_post_filename_with_special_characters
6.86s call cherrypy/test/test_static.py::StaticTest::test_file_stream
6.78s call cherrypy/test/test_states.py::ServerStateTests::test_4_Autoreload
5.21s call cherrypy/test/test_states.py::SignalHandlingTests::test_SIGHUP_daemonized
4.52s call cherrypy/test/test_states.py::SignalHandlingTests::test_SIGTERM
4.22s call cherrypy/test/test_session.py::SessionTest::test_0_Session
4.03s call cherrypy/test/test_conn.py::PipelineTests::test_HTTP11_Timeout_after_request
4.01s call cherrypy/test/test_conn.py::PipelineTests::test_HTTP11_Timeout
3.20s call cherrypy/test/test_states.py::PluginTests::test_daemonize
3.01s call cherrypy/test/test_http.py::HTTPTests::test_no_content_length
========================================================================= short test summary info ==========================================================================
SKIPPED [1] cherrypy/test/helper.py:321: skipped (not running HTTPS)...
SKIPPED [2] cherrypy/test/test_routes.py:22: Install routes to test RoutesDispatcher code
SKIPPED [1] cherrypy/test/test_static.py:226: Windows only
XFAIL cherrypy/test/test_static.py::StaticTest::test_file_stream
#1475
ERROR cherrypy/test/test_session.py::MemcachedSessionTest::test_0_Session
ERROR cherrypy/test/test_session.py::MemcachedSessionTest::test_1_Concurrency
ERROR cherrypy/test/test_session.py::MemcachedSessionTest::test_3_Redirect
ERROR cherrypy/test/test_session.py::MemcachedSessionTest::test_5_Error_paths
ERROR cherrypy/test/test_session.py::MemcachedSessionTest::test_gc
============================================== 287 passed, 4 skipped, 1 deselected, 1 xfailed, 5 errors in 132.18s (0:02:12) ===============================================
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bd27255d-a661-4d84-a6b0-ae4ab09a9471/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bd27255d-a661-4d84-a6b0-ae4ab09a9471/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bd27255d-a661-4d84-a6b0-ae4ab09a9471/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bd27255d-a661-4d84-a6b0-ae4ab09a9471/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bd27255d-a661-4d84-a6b0-ae4ab09a9471/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bd27255d-a661-4d84-a6b0-ae4ab09a9471
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-bd27255d-a661-4d84-a6b0-ae4ab09a9471'
warnings.warn(
/home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/cherrypy/process/wspbus.py:254: RuntimeWarning: The main thread is exiting, but the Bus is in the states.STARTED state; shutting it down automatically now. You must either call bus.block() after start(), or call bus.exit() before the main thread exits.
warnings.warn( I cannot find what provides |
I thought |
+ /usr/bin/pytest -ra --fixtures -q -p no:randomly
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0, configfile: pytest.ini, testpaths: cherrypy/test/
plugins: cov-3.0.0
collected 298 items
cache -- .../_pytest/cacheprovider.py:510
Return a cache object that can persist state between testing sessions.
capsys -- .../_pytest/capture.py:878
Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``.
capsysbinary -- .../_pytest/capture.py:895
Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``.
capfd -- .../_pytest/capture.py:912
Enable text capturing of writes to file descriptors ``1`` and ``2``.
capfdbinary -- .../_pytest/capture.py:929
Enable bytes capturing of writes to file descriptors ``1`` and ``2``.
doctest_namespace [session scope] -- .../_pytest/doctest.py:731
Fixture that returns a :py:class:`dict` that will be injected into the
namespace of doctests.
pytestconfig [session scope] -- .../_pytest/fixtures.py:1334
Session-scoped fixture that returns the session's :class:`pytest.Config`
object.
record_property -- .../_pytest/junitxml.py:282
Add extra properties to the calling test.
record_xml_attribute -- .../_pytest/junitxml.py:305
Add extra xml attributes to the tag for the calling test.
record_testsuite_property [session scope] -- .../_pytest/junitxml.py:343
Record a new ``<property>`` tag as child of the root ``<testsuite>``.
tmpdir_factory [session scope] -- .../_pytest/legacypath.py:295
Return a :class:`pytest.TempdirFactory` instance for the test session.
tmpdir -- .../_pytest/legacypath.py:302
Return a temporary directory path object which is unique to each test
function invocation, created as a sub directory of the base temporary
directory.
caplog -- .../_pytest/logging.py:487
Access and control log capturing.
monkeypatch -- .../_pytest/monkeypatch.py:29
A convenient fixture for monkey-patching.
recwarn -- .../_pytest/recwarn.py:29
Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.
tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:184
Return a :class:`pytest.TempPathFactory` instance for the test session.
tmp_path -- .../_pytest/tmpdir.py:199
Return a temporary directory path object which is unique to each test
function invocation, created as a sub directory of the base temporary
directory.
----------------------------------------------------------------- fixtures defined from pytest_cov.plugin ------------------------------------------------------------------
no_cover -- ../../../../../usr/lib/python3.8/site-packages/pytest_cov/plugin.py:386
A pytest fixture to disable coverage.
cov -- ../../../../../usr/lib/python3.8/site-packages/pytest_cov/plugin.py:392
A pytest fixture to provide access to the underlying coverage object.
--------------------------------------------------------------- fixtures defined from cherrypy.test.test_bus ---------------------------------------------------------------
bus -- cherrypy/test/test_bus.py:20
Return a wspbus instance.
log_tracker -- cherrypy/test/test_bus.py:26
Return an instance of bus log tracker.
listener -- cherrypy/test/test_bus.py:42
Return an instance of bus response tracker.
------------------------------------------------------------- fixtures defined from cherrypy.test.test_native --------------------------------------------------------------
cp_native_server -- cherrypy/test/test_native.py:16
A native server.
------------------------------------------------------------- fixtures defined from cherrypy.test.test_static --------------------------------------------------------------
unicode_filesystem -- cherrypy/test/test_static.py:23
no docstring available
------------------------------------------------------------- fixtures defined from cherrypy.test.test_logging -------------------------------------------------------------
log_tracker -- cherrypy/test/test_logging.py:103
no docstring available
access_log_file -- cherrypy/test/test_logging.py:19
no docstring available
error_log_file -- cherrypy/test/test_logging.py:24
no docstring available
server -- cherrypy/test/test_logging.py:29
no docstring available
configure_server -- cherrypy/test/test_logging.py:48
no docstring available
------------------------------------------------------------- fixtures defined from cherrypy.test.test_session -------------------------------------------------------------
memcached_server_present [session scope] -- cherrypy/test/test_session.py:410
no docstring available
memcached_client_present -- cherrypy/test/test_session.py:415
no docstring available
memcached_instance [session scope] -- cherrypy/test/test_session.py:420
Start up an instance of memcached.
memcached_configured -- cherrypy/test/test_session.py:444
no docstring available
------------------------------------ generated xml file: /home/tkloczko/rpmbuild/BUILD/cherrypy-18.7.0/.test-results/pytest/results.xml ------------------------------------
========================================================================== no tests ran in 1.30s =========================================================================== |
Does it mean that I need to have installed memcached in build env? 🤔 |
Gentle ping .. any update? 🤔 |
I've just tested 18.9.0 with added Here is pytest output:+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-cherrypy-18.9.0-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-cherrypy-18.9.0-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' -q -p no:randomly
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0
configfile: pytest.ini
testpaths: cherrypy/test/
plugins: services-2.2.1
collected 300 items
cherrypy/test/test_auth_basic.py ..... [ 1%]
cherrypy/test/test_auth_digest.py ...... [ 3%]
cherrypy/test/test_bus.py ............ [ 7%]
cherrypy/test/test_caching.py .....X.. [ 10%]
cherrypy/test/test_config.py .......... [ 13%]
cherrypy/test/test_config_server.py ..... [ 15%]
cherrypy/test/test_conn.py ...................... [ 22%]
cherrypy/test/test_core.py .................... [ 29%]
cherrypy/test/test_dynamicobjectmapping.py .... [ 30%]
cherrypy/test/test_encoding.py ......Exception ignored in: <_io.FileIO name=16 mode='rb+' closefd=True>
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/_pytest/unraisableexception.py", line 59, in __exit__
del self.unraisable
ResourceWarning: unclosed file <_io.BufferedRandom name=16>
....... [ 35%]
cherrypy/test/test_etags.py .... [ 36%]
cherrypy/test/test_http.py .s....... [ 39%]
cherrypy/test/test_httputil.py ......................... [ 47%]
cherrypy/test/test_iterator.py .. [ 48%]
cherrypy/test/test_json.py .... [ 49%]
cherrypy/test/test_logging.py FFFFFFF. [ 52%]
cherrypy/test/test_mime.py ..... [ 54%]
cherrypy/test/test_misc_tools.py .......... [ 57%]
cherrypy/test/test_native.py . [ 57%]
cherrypy/test/test_objectmapping.py ......... [ 60%]
cherrypy/test/test_params.py .... [ 62%]
cherrypy/test/test_plugins.py . [ 62%]
cherrypy/test/test_proxy.py ... [ 63%]
cherrypy/test/test_refleaks.py .. [ 64%]
cherrypy/test/test_request_obj.py .................. [ 70%]
cherrypy/test/test_routes.py ss [ 70%]
cherrypy/test/test_session.py ..........Esssss [ 75%]
cherrypy/test/test_sessionauthenticate.py .. [ 76%]
cherrypy/test/test_states.py .............. [ 81%]
cherrypy/test/test_static.py ....x........s.. [ 86%]
cherrypy/test/test_tools.py ............ [ 90%]
cherrypy/test/test_tutorials.py ........... [ 94%]
cherrypy/test/test_virtualhost.py ... [ 95%]
cherrypy/test/test_wsgi_ns.py .. [ 95%]
cherrypy/test/test_wsgi_unix_socket.py .... [ 97%]
cherrypy/test/test_wsgi_vhost.py .. [ 97%]
cherrypy/test/test_wsgiapps.py ..... [ 99%]
cherrypy/test/test_xmlrpc.py .. [100%]
==================================== ERRORS ====================================
___________________ ERROR at teardown of SessionTest.test_gc ___________________
cls = <class 'cherrypy.test.test_session.SessionTest'>
@classmethod
def teardown_class(cls):
"""Clean up sessions."""
super(cls, cls).teardown_class()
consume(
file.remove_p()
> for file in localDir.listdir()
if file.basename().startswith(
sessions.FileSession.SESSION_PREFIX
)
)
__class__ = <class 'cherrypy.test.test_session.SessionTest'>
cls = <class 'cherrypy.test.test_session.SessionTest'>
cherrypy/test/test_session.py:151:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Path('/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/test')
match = None
def listdir(self, match=None):
> warnings.warn(
".listdir is deprecated; use iterdir",
DeprecationWarning,
stacklevel=2,
)
E DeprecationWarning: .listdir is deprecated; use iterdir
match = None
self = Path('/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/test')
/usr/lib/python3.8/site-packages/path/__init__.py:495: DeprecationWarning
------------------------------ Captured log call -------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:28:20]
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 342, in access
return request.app.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cprequest.py", line 627, in run
cherrypy.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 344, in access
return _cplogging.LogManager.access(self)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:28:20] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:28:20] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:28:20] ENGINE Stopped thread 'Session cleanup'.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:28:20] ENGINE Stopped thread 'Session cleanup'.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:28:20] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:28:20] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:28:20] ENGINE Bus EXITED
=================================== FAILURES ===================================
______________________________ test_normal_return ______________________________
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b297be50>
server = None
def test_normal_return(log_tracker, server):
log_tracker.markLog()
host = webtest.interface(webtest.WebCase.HOST)
port = webtest.WebCase.PORT
resp = requests.get(
'http://%s:%s/as_string' % (host, port),
headers={
'Referer': 'http://www.cherrypy.dev/',
'User-Agent': 'Mozilla/5.0',
},
)
expected_body = 'content'
assert resp.text == expected_body
assert resp.status_code == 200
intro = '%s - - [' % host
> log_tracker.assertLog(-1, intro)
expected_body = 'content'
host = '127.0.0.1'
intro = '127.0.0.1 - - ['
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b297be50>
port = 54583
resp = <Response [200]>
server = None
cherrypy/test/test_logging.py:127:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b297be50>
sliceargs = -1, lines = b'127.0.0.1 - - [', marker = None
def assertLog(self, sliceargs, lines, marker=None):
"""Fail if log.readlines()[sliceargs] is not contained in 'lines'.
The log will be searched from the given marker to the next marker.
If marker is None, self.lastmarker is used. If the log hasn't
been marked (using self.markLog), the entire log will be searched.
"""
data = self._read_marked_region(marker)
if isinstance(sliceargs, int):
# Single arg. Use __getitem__ and allow lines to be str or list.
if isinstance(lines, (tuple, list)):
lines = lines[0]
if isinstance(lines, str):
lines = lines.encode('utf-8')
> if lines not in data[sliceargs]:
E IndexError: list index out of range
data = []
lines = b'127.0.0.1 - - ['
marker = None
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b297be50>
sliceargs = -1
cherrypy/test/logtest.py:214: IndexError
------------------------------ Captured log setup ------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:50] ENGINE Bus STARTING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Serving on http://127.0.0.1:54583
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] unsubsig: False
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] Subscribing the new one.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Bus STARTED
------------------------------ Captured log call -------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51]
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 342, in access
return request.app.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cprequest.py", line 627, in run
cherrypy.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 344, in access
return _cplogging.LogManager.access(self)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Bus EXITED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Waiting for child threads to terminate...
______________________________ test_normal_yield _______________________________
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2a7df10>
server = None
def test_normal_yield(log_tracker, server):
log_tracker.markLog()
host = webtest.interface(webtest.WebCase.HOST)
port = webtest.WebCase.PORT
resp = requests.get(
'http://%s:%s/as_yield' % (host, port),
headers={
'User-Agent': '',
},
)
expected_body = 'content'
assert resp.text == expected_body
assert resp.status_code == 200
intro = '%s - - [' % host
> log_tracker.assertLog(-1, intro)
expected_body = 'content'
host = '127.0.0.1'
intro = '127.0.0.1 - - ['
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2a7df10>
port = 54583
resp = <Response [200]>
server = None
cherrypy/test/test_logging.py:160:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2a7df10>
sliceargs = -1, lines = b'127.0.0.1 - - [', marker = None
def assertLog(self, sliceargs, lines, marker=None):
"""Fail if log.readlines()[sliceargs] is not contained in 'lines'.
The log will be searched from the given marker to the next marker.
If marker is None, self.lastmarker is used. If the log hasn't
been marked (using self.markLog), the entire log will be searched.
"""
data = self._read_marked_region(marker)
if isinstance(sliceargs, int):
# Single arg. Use __getitem__ and allow lines to be str or list.
if isinstance(lines, (tuple, list)):
lines = lines[0]
if isinstance(lines, str):
lines = lines.encode('utf-8')
> if lines not in data[sliceargs]:
E IndexError: list index out of range
data = []
lines = b'127.0.0.1 - - ['
marker = None
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2a7df10>
sliceargs = -1
cherrypy/test/logtest.py:214: IndexError
------------------------------ Captured log setup ------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Bus STARTING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Serving on http://127.0.0.1:54583
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] unsubsig: False
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] Subscribing the new one.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Bus STARTED
------------------------------ Captured log call -------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51]
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 342, in access
return request.app.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cprequest.py", line 627, in run
cherrypy.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 344, in access
return _cplogging.LogManager.access(self)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:51] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus EXITED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Waiting for child threads to terminate...
____________________________ test_custom_log_format ____________________________
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2859d90>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f47b28c3b80>
server = None
def test_custom_log_format(log_tracker, monkeypatch, server):
"""Test a customized access_log_format string, which is a
feature of _cplogging.LogManager.access()."""
monkeypatch.setattr(
'cherrypy._cplogging.LogManager.access_log_format',
'{h} {l} {u} {t} "{r}" {s} {b} "{f}" "{a}" {o}',
)
log_tracker.markLog()
host = webtest.interface(webtest.WebCase.HOST)
port = webtest.WebCase.PORT
requests.get(
'http://%s:%s/as_string' % (host, port),
headers={
'Referer': 'REFERER',
'User-Agent': 'USERAGENT',
'Host': 'HOST',
},
)
> log_tracker.assertLog(-1, '%s - - [' % host)
host = '127.0.0.1'
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2859d90>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f47b28c3b80>
port = 54583
server = None
cherrypy/test/test_logging.py:193:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2859d90>
sliceargs = -1, lines = b'127.0.0.1 - - [', marker = None
def assertLog(self, sliceargs, lines, marker=None):
"""Fail if log.readlines()[sliceargs] is not contained in 'lines'.
The log will be searched from the given marker to the next marker.
If marker is None, self.lastmarker is used. If the log hasn't
been marked (using self.markLog), the entire log will be searched.
"""
data = self._read_marked_region(marker)
if isinstance(sliceargs, int):
# Single arg. Use __getitem__ and allow lines to be str or list.
if isinstance(lines, (tuple, list)):
lines = lines[0]
if isinstance(lines, str):
lines = lines.encode('utf-8')
> if lines not in data[sliceargs]:
E IndexError: list index out of range
data = []
lines = b'127.0.0.1 - - ['
marker = None
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2859d90>
sliceargs = -1
cherrypy/test/logtest.py:214: IndexError
------------------------------ Captured log setup ------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus STARTING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Serving on http://127.0.0.1:54583
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] unsubsig: False
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] Subscribing the new one.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus STARTED
------------------------------ Captured log call -------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52]
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 342, in access
return request.app.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cprequest.py", line 627, in run
cherrypy.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 344, in access
return _cplogging.LogManager.access(self)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus EXITED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Waiting for child threads to terminate...
______________________________ test_utc_in_timez _______________________________
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f47b2a7d220>
def test_utc_in_timez(monkeypatch):
"""Test that ``LazyRfc3339UtcTime`` is rendered as ``str`` using UTC timestamp."""
utcoffset8_local_time_in_naive_utc = (
datetime.datetime(
year=2020,
month=1,
day=1,
hour=1,
minute=23,
second=45,
tzinfo=datetime.timezone(datetime.timedelta(hours=8)),
)
.astimezone(datetime.timezone.utc)
.replace(tzinfo=None)
)
class mock_datetime:
@classmethod
def now(cls, _):
return utcoffset8_local_time_in_naive_utc
monkeypatch.setattr('datetime.datetime', mock_datetime)
> rfc3339_utc_time = str(cherrypy._cplogging.LazyRfc3339UtcTime())
mock_datetime = <class 'cherrypy.test.test_logging.test_utc_in_timez.<locals>.mock_datetime'>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f47b2a7d220>
utcoffset8_local_time_in_naive_utc = datetime.datetime(2019, 12, 31, 17, 23, 45)
cherrypy/test/test_logging.py:223:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cherrypy._cplogging.LazyRfc3339UtcTime object at 0x7f47b28fef40>
def __str__(self):
"""Return datetime in RFC3339 UTC Format."""
> iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
E AttributeError: module 'datetime' has no attribute 'UTC'
self = <cherrypy._cplogging.LazyRfc3339UtcTime object at 0x7f47b28fef40>
cherrypy/_cplogging.py:456: AttributeError
____________________________ test_timez_log_format _____________________________
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2976ac0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f47b29760a0>
server = None
def test_timez_log_format(log_tracker, monkeypatch, server):
"""Test a customized access_log_format string, which is a
feature of _cplogging.LogManager.access()."""
monkeypatch.setattr(
'cherrypy._cplogging.LogManager.access_log_format',
'{h} {l} {u} {z} "{r}" {s} {b} "{f}" "{a}" {o}',
)
log_tracker.markLog()
> expected_time = str(cherrypy._cplogging.LazyRfc3339UtcTime())
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2976ac0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f47b29760a0>
server = None
cherrypy/test/test_logging.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cherrypy._cplogging.LazyRfc3339UtcTime object at 0x7f47b2930610>
def __str__(self):
"""Return datetime in RFC3339 UTC Format."""
> iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
E AttributeError: module 'datetime' has no attribute 'UTC'
self = <cherrypy._cplogging.LazyRfc3339UtcTime object at 0x7f47b2930610>
cherrypy/_cplogging.py:456: AttributeError
------------------------------ Captured log setup ------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:52] ENGINE Bus STARTING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Serving on http://127.0.0.1:54583
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] unsubsig: False
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] Subscribing the new one.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Bus STARTED
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Bus EXITED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Waiting for child threads to terminate...
_______________________ test_UUIDv4_parameter_log_format _______________________
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b28422e0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f47b28fe790>
server = None
def test_UUIDv4_parameter_log_format(log_tracker, monkeypatch, server):
"""Test rendering of UUID4 within access log."""
monkeypatch.setattr(
'cherrypy._cplogging.LogManager.access_log_format',
'{i}',
)
log_tracker.markLog()
host = webtest.interface(webtest.WebCase.HOST)
port = webtest.WebCase.PORT
requests.get('http://%s:%s/as_string' % (host, port))
> log_tracker.assertValidUUIDv4()
host = '127.0.0.1'
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b28422e0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f47b28fe790>
port = 54583
server = None
cherrypy/test/test_logging.py:272:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b28422e0>
marker = None
def assertValidUUIDv4(self, marker=None):
"""Fail if the given UUIDv4 is not valid.
The log will be searched from the given marker to the next marker.
If marker is None, self.lastmarker is used. If the log hasn't
been marked (using self.markLog), the entire log will be searched.
"""
data = self._read_marked_region(marker)
data = [
chunk.decode('utf-8').rstrip('\n').rstrip('\r')
for chunk in data
]
for log_chunk in data:
try:
uuid_log = data[-1]
uuid_obj = UUID(uuid_log, version=4)
except (TypeError, ValueError):
pass # it might be in other chunk
else:
if str(uuid_obj) == uuid_log:
return
msg = '%r is not a valid UUIDv4' % uuid_log
self._handleLogError(msg, data, marker, log_chunk)
msg = 'UUIDv4 not found in log'
> self._handleLogError(msg, data, marker, log_chunk)
E UnboundLocalError: local variable 'log_chunk' referenced before assignment
data = []
marker = None
msg = 'UUIDv4 not found in log'
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b28422e0>
cherrypy/test/logtest.py:198: UnboundLocalError
------------------------------ Captured log setup ------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Bus STARTING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Serving on http://127.0.0.1:54583
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] unsubsig: False
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] Subscribing the new one.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Bus STARTED
------------------------------ Captured log call -------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53]
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 342, in access
return request.app.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cprequest.py", line 627, in run
cherrypy.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 344, in access
return _cplogging.LogManager.access(self)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:53] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus EXITED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Waiting for child threads to terminate...
_____________________________ test_escaped_output ______________________________
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2a3ecd0>
server = None
def test_escaped_output(log_tracker, server):
# Test unicode in access log pieces.
log_tracker.markLog()
host = webtest.interface(webtest.WebCase.HOST)
port = webtest.WebCase.PORT
resp = requests.get('http://%s:%s/uni_code' % (host, port))
assert resp.status_code == 200
# The repr of a bytestring includes a b'' prefix
> log_tracker.assertLog(-1, repr(tartaros.encode('utf8'))[2:-1])
host = '127.0.0.1'
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2a3ecd0>
port = 54583
resp = <Response [200]>
server = None
cherrypy/test/test_logging.py:283:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2a3ecd0>
sliceargs = -1
lines = b'\\xce\\xa4\\xe1\\xbd\\xb1\\xcf\\x81\\xcf\\x84\\xce\\xb1\\xcf\\x81\\xce\\xbf\\xcf\\x82'
marker = None
def assertLog(self, sliceargs, lines, marker=None):
"""Fail if log.readlines()[sliceargs] is not contained in 'lines'.
The log will be searched from the given marker to the next marker.
If marker is None, self.lastmarker is used. If the log hasn't
been marked (using self.markLog), the entire log will be searched.
"""
data = self._read_marked_region(marker)
if isinstance(sliceargs, int):
# Single arg. Use __getitem__ and allow lines to be str or list.
if isinstance(lines, (tuple, list)):
lines = lines[0]
if isinstance(lines, str):
lines = lines.encode('utf-8')
> if lines not in data[sliceargs]:
E IndexError: list index out of range
data = []
lines = b'\\xce\\xa4\\xe1\\xbd\\xb1\\xcf\\x81\\xcf\\x84\\xce\\xb1\\xcf\\x81\\xce\\xbf\\xcf\\x82'
marker = None
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f47b2a3ecd0>
sliceargs = -1
cherrypy/test/logtest.py:214: IndexError
------------------------------ Captured log setup ------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus STARTING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Serving on http://127.0.0.1:54583
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] unsubsig: False
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] Subscribing the new one.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus STARTED
------------------------------ Captured log call -------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54]
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 342, in access
return request.app.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cprequest.py", line 627, in run
cherrypy.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 344, in access
return _cplogging.LogManager.access(self)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Bus EXITED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:27:54] ENGINE Waiting for child threads to terminate...
- generated xml file: /home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/.test-results/pytest/results.xml -
============================= slowest 10 durations =============================
10.53s call cherrypy/test/test_http.py::HTTPTests::test_post_filename_with_special_characters
8.53s call cherrypy/test/test_caching.py::CacheTest::test_antistampede
5.97s call cherrypy/test/test_states.py::ServerStateTests::test_4_Autoreload
4.76s call cherrypy/test/test_states.py::SignalHandlingTests::test_SIGHUP_daemonized
4.17s call cherrypy/test/test_session.py::SessionTest::test_0_Session
4.02s call cherrypy/test/test_conn.py::PipelineTests::test_HTTP11_Timeout_after_request
4.01s call cherrypy/test/test_conn.py::PipelineTests::test_HTTP11_Timeout
3.91s call cherrypy/test/test_static.py::StaticTest::test_file_stream
3.65s call cherrypy/test/test_states.py::SignalHandlingTests::test_SIGTERM
3.01s call cherrypy/test/test_http.py::HTTPTests::test_no_content_length
=========================== short test summary info ============================
SKIPPED [1] cherrypy/test/helper.py:321: skipped (not running HTTPS)...
SKIPPED [2] cherrypy/test/test_routes.py:22: Install routes to test RoutesDispatcher code
SKIPPED [1] cherrypy/test/test_session.py:464: memcached not available
SKIPPED [1] cherrypy/test/test_session.py:494: memcached not available
SKIPPED [1] cherrypy/test/test_session.py:530: memcached not available
SKIPPED [1] cherrypy/test/test_session.py:536: memcached not available
SKIPPED [1] cherrypy/test/helper.py:287: memcached not available
SKIPPED [1] cherrypy/test/test_static.py:226: Windows only
XFAIL cherrypy/test/test_static.py::StaticTest::test_file_stream - #1475
XPASS cherrypy/test/test_caching.py::CacheTest::test_antistampede #1536
ERROR cherrypy/test/test_session.py::SessionTest::test_gc - DeprecationWarnin...
FAILED cherrypy/test/test_logging.py::test_normal_return - IndexError: list i...
FAILED cherrypy/test/test_logging.py::test_normal_yield - IndexError: list in...
FAILED cherrypy/test/test_logging.py::test_custom_log_format - IndexError: li...
FAILED cherrypy/test/test_logging.py::test_utc_in_timez - AttributeError: mod...
FAILED cherrypy/test/test_logging.py::test_timez_log_format - AttributeError:...
FAILED cherrypy/test/test_logging.py::test_UUIDv4_parameter_log_format - Unbo...
FAILED cherrypy/test/test_logging.py::test_escaped_output - IndexError: list ...
= 7 failed, 282 passed, 9 skipped, 1 xfailed, 1 xpassed, 1 error in 129.19s (0:02:09) =
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-f16d4907-01d7-4083-9c5d-63ed169c3c03/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-f16d4907-01d7-4083-9c5d-63ed169c3c03/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-f16d4907-01d7-4083-9c5d-63ed169c3c03/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-f16d4907-01d7-4083-9c5d-63ed169c3c03/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-f16d4907-01d7-4083-9c5d-63ed169c3c03/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-f16d4907-01d7-4083-9c5d-63ed169c3c03
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-f16d4907-01d7-4083-9c5d-63ed169c3c03'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-d9c1ba34-a2fd-4834-9d9f-27ba63c00412/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-d9c1ba34-a2fd-4834-9d9f-27ba63c00412/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-d9c1ba34-a2fd-4834-9d9f-27ba63c00412/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-d9c1ba34-a2fd-4834-9d9f-27ba63c00412/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-d9c1ba34-a2fd-4834-9d9f-27ba63c00412
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-d9c1ba34-a2fd-4834-9d9f-27ba63c00412'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1ef2fc32-0829-4ff6-a31c-898a4b1912af/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1ef2fc32-0829-4ff6-a31c-898a4b1912af/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1ef2fc32-0829-4ff6-a31c-898a4b1912af/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1ef2fc32-0829-4ff6-a31c-898a4b1912af/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1ef2fc32-0829-4ff6-a31c-898a4b1912af
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-1ef2fc32-0829-4ff6-a31c-898a4b1912af'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-986dc389-9452-4256-9c27-7c789b90f0ec/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-986dc389-9452-4256-9c27-7c789b90f0ec/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-986dc389-9452-4256-9c27-7c789b90f0ec/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-986dc389-9452-4256-9c27-7c789b90f0ec/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-986dc389-9452-4256-9c27-7c789b90f0ec
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-986dc389-9452-4256-9c27-7c789b90f0ec'
warnings.warn(
/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/process/wspbus.py:254: RuntimeWarning: The main thread is exiting, but the Bus is in the states.STARTED state; shutting it down automatically now. You must either call bus.block() after start(), or call bus.exit() before the main thread exits.
warnings.warn( |
After add all all failing units to --deselect list another new fail and error popped out. Here is pytest output:+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-cherrypy-18.9.0-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-cherrypy-18.9.0-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' -q -p no:randomly --deselect cherrypy/test/test_logging.py::test_UUIDv4_parameter_log_format --deselect cherrypy/test/test_logging.py::test_custom_log_format --deselect cherrypy/test/test_logging.py::test_normal_return --deselect cherrypy/test/test_logging.py::test_normal_yield --deselect cherrypy/test/test_logging.py::test_timez_log_format --deselect cherrypy/test/test_logging.py::test_utc_in_timez --deselect cherrypy/test/test_session.py::SessionTest::test_gc
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0
configfile: pytest.ini
testpaths: cherrypy/test/
plugins: services-2.2.1
collected 300 items / 7 deselected / 293 selected
cherrypy/test/test_auth_basic.py ..... [ 1%]
cherrypy/test/test_auth_digest.py ...... [ 3%]
cherrypy/test/test_bus.py ............ [ 7%]
cherrypy/test/test_caching.py .....X.. [ 10%]
cherrypy/test/test_config.py .......... [ 13%]
cherrypy/test/test_config_server.py ..... [ 15%]
cherrypy/test/test_conn.py ...................... [ 23%]
cherrypy/test/test_core.py .................... [ 30%]
cherrypy/test/test_dynamicobjectmapping.py .... [ 31%]
cherrypy/test/test_encoding.py ......Exception ignored in: <_io.FileIO name=16 mode='rb+' closefd=True>
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/_pytest/unraisableexception.py", line 59, in __exit__
del self.unraisable
ResourceWarning: unclosed file <_io.BufferedRandom name=16>
....... [ 35%]
cherrypy/test/test_etags.py .... [ 37%]
cherrypy/test/test_http.py .s....... [ 40%]
cherrypy/test/test_httputil.py ......................... [ 48%]
cherrypy/test/test_iterator.py .. [ 49%]
cherrypy/test/test_json.py .... [ 50%]
cherrypy/test/test_logging.py F. [ 51%]
cherrypy/test/test_mime.py ..... [ 53%]
cherrypy/test/test_misc_tools.py .......... [ 56%]
cherrypy/test/test_native.py . [ 56%]
cherrypy/test/test_objectmapping.py ......... [ 60%]
cherrypy/test/test_params.py .... [ 61%]
cherrypy/test/test_plugins.py . [ 61%]
cherrypy/test/test_proxy.py ... [ 62%]
cherrypy/test/test_refleaks.py .. [ 63%]
cherrypy/test/test_request_obj.py .................. [ 69%]
cherrypy/test/test_routes.py ss [ 70%]
cherrypy/test/test_session.py .........Esssss [ 75%]
cherrypy/test/test_sessionauthenticate.py .. [ 75%]
cherrypy/test/test_states.py .............. [ 80%]
cherrypy/test/test_static.py ....x........s.. [ 86%]
cherrypy/test/test_tools.py ............ [ 90%]
cherrypy/test/test_tutorials.py ........... [ 93%]
cherrypy/test/test_virtualhost.py ... [ 94%]
cherrypy/test/test_wsgi_ns.py .. [ 95%]
cherrypy/test/test_wsgi_unix_socket.py .... [ 96%]
cherrypy/test/test_wsgi_vhost.py .. [ 97%]
cherrypy/test/test_wsgiapps.py ..... [ 99%]
cherrypy/test/test_xmlrpc.py .. [100%]
==================================== ERRORS ====================================
_____________ ERROR at teardown of SessionTest.test_8_Ram_Cleanup ______________
cls = <class 'cherrypy.test.test_session.SessionTest'>
@classmethod
def teardown_class(cls):
"""Clean up sessions."""
super(cls, cls).teardown_class()
consume(
file.remove_p()
> for file in localDir.listdir()
if file.basename().startswith(
sessions.FileSession.SESSION_PREFIX
)
)
__class__ = <class 'cherrypy.test.test_session.SessionTest'>
cls = <class 'cherrypy.test.test_session.SessionTest'>
cherrypy/test/test_session.py:151:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Path('/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/test')
match = None
def listdir(self, match=None):
> warnings.warn(
".listdir is deprecated; use iterdir",
DeprecationWarning,
stacklevel=2,
)
E DeprecationWarning: .listdir is deprecated; use iterdir
match = None
self = Path('/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/test')
/usr/lib/python3.8/site-packages/path/__init__.py:495: DeprecationWarning
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:43:08] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:43:09] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:43:09] ENGINE Stopped thread 'Session cleanup'.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:43:09] ENGINE Stopped thread 'Session cleanup'.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:43:09] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:43:09] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:43:09] ENGINE Bus EXITED
=================================== FAILURES ===================================
_____________________________ test_escaped_output ______________________________
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f40d43f6850>
server = None
def test_escaped_output(log_tracker, server):
# Test unicode in access log pieces.
log_tracker.markLog()
host = webtest.interface(webtest.WebCase.HOST)
port = webtest.WebCase.PORT
resp = requests.get('http://%s:%s/uni_code' % (host, port))
assert resp.status_code == 200
# The repr of a bytestring includes a b'' prefix
> log_tracker.assertLog(-1, repr(tartaros.encode('utf8'))[2:-1])
host = '127.0.0.1'
log_tracker = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f40d43f6850>
port = 54583
resp = <Response [200]>
server = None
cherrypy/test/test_logging.py:283:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f40d43f6850>
sliceargs = -1
lines = b'\\xce\\xa4\\xe1\\xbd\\xb1\\xcf\\x81\\xcf\\x84\\xce\\xb1\\xcf\\x81\\xce\\xbf\\xcf\\x82'
marker = None
def assertLog(self, sliceargs, lines, marker=None):
"""Fail if log.readlines()[sliceargs] is not contained in 'lines'.
The log will be searched from the given marker to the next marker.
If marker is None, self.lastmarker is used. If the log hasn't
been marked (using self.markLog), the entire log will be searched.
"""
data = self._read_marked_region(marker)
if isinstance(sliceargs, int):
# Single arg. Use __getitem__ and allow lines to be str or list.
if isinstance(lines, (tuple, list)):
lines = lines[0]
if isinstance(lines, str):
lines = lines.encode('utf-8')
> if lines not in data[sliceargs]:
E IndexError: list index out of range
data = []
lines = b'\\xce\\xa4\\xe1\\xbd\\xb1\\xcf\\x81\\xcf\\x84\\xce\\xb1\\xcf\\x81\\xce\\xbf\\xcf\\x82'
marker = None
self = <cherrypy.test.test_logging.log_tracker.<locals>.LogTracker object at 0x7f40d43f6850>
sliceargs = -1
cherrypy/test/logtest.py:214: IndexError
------------------------------ Captured log setup ------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:42] ENGINE Bus STARTING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:42] ENGINE Serving on http://127.0.0.1:54583
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:42] unsubsig: False
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:42] Subscribing the new one.
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:42] ENGINE Bus STARTED
------------------------------ Captured log call -------------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:42]
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 342, in access
return request.app.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cprequest.py", line 627, in run
cherrypy.log.access()
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/__init__.py", line 344, in access
return _cplogging.LogManager.access(self)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 268, in access
v = str(v)
File "/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/_cplogging.py", line 456, in __str__
iso_formatted_now = datetime.datetime.now(datetime.UTC).isoformat('T')
AttributeError: module 'datetime' has no attribute 'UTC'
---------------------------- Captured log teardown -----------------------------
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:42] ENGINE Bus STOPPING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:43] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 54583)) shut down
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:43] ENGINE Bus STOPPED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:43] ENGINE Bus EXITING
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:43] ENGINE Bus EXITED
INFO cherrypy.error:_cplogging.py:213 [24/Dec/2023:22:42:43] ENGINE Waiting for child threads to terminate...
- generated xml file: /home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/.test-results/pytest/results.xml -
============================= slowest 10 durations =============================
10.53s call cherrypy/test/test_http.py::HTTPTests::test_post_filename_with_special_characters
8.52s call cherrypy/test/test_caching.py::CacheTest::test_antistampede
5.97s call cherrypy/test/test_states.py::ServerStateTests::test_4_Autoreload
4.75s call cherrypy/test/test_states.py::SignalHandlingTests::test_SIGHUP_daemonized
4.16s call cherrypy/test/test_session.py::SessionTest::test_0_Session
4.02s call cherrypy/test/test_conn.py::PipelineTests::test_HTTP11_Timeout_after_request
4.01s call cherrypy/test/test_conn.py::PipelineTests::test_HTTP11_Timeout
3.64s call cherrypy/test/test_states.py::SignalHandlingTests::test_SIGTERM
3.01s call cherrypy/test/test_http.py::HTTPTests::test_no_content_length
2.75s call cherrypy/test/test_states.py::PluginTests::test_daemonize
=========================== short test summary info ============================
SKIPPED [1] cherrypy/test/helper.py:321: skipped (not running HTTPS)...
SKIPPED [2] cherrypy/test/test_routes.py:22: Install routes to test RoutesDispatcher code
SKIPPED [1] cherrypy/test/test_session.py:464: memcached not available
SKIPPED [1] cherrypy/test/test_session.py:494: memcached not available
SKIPPED [1] cherrypy/test/test_session.py:530: memcached not available
SKIPPED [1] cherrypy/test/test_session.py:536: memcached not available
SKIPPED [1] cherrypy/test/helper.py:287: memcached not available
SKIPPED [1] cherrypy/test/test_static.py:226: Windows only
XFAIL cherrypy/test/test_static.py::StaticTest::test_file_stream - #1475
XPASS cherrypy/test/test_caching.py::CacheTest::test_antistampede #1536
ERROR cherrypy/test/test_session.py::SessionTest::test_8_Ram_Cleanup - Deprec...
FAILED cherrypy/test/test_logging.py::test_escaped_output - IndexError: list ...
= 1 failed, 281 passed, 9 skipped, 7 deselected, 1 xfailed, 1 xpassed, 1 error in 123.88s (0:02:03) =
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-0bdb3d4d-4164-487d-83fa-14408e127755/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-0bdb3d4d-4164-487d-83fa-14408e127755/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-0bdb3d4d-4164-487d-83fa-14408e127755/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-0bdb3d4d-4164-487d-83fa-14408e127755/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-0bdb3d4d-4164-487d-83fa-14408e127755/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-0bdb3d4d-4164-487d-83fa-14408e127755
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-0bdb3d4d-4164-487d-83fa-14408e127755'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-444f3884-bb92-4aa3-b074-68df6b70d6f1/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-444f3884-bb92-4aa3-b074-68df6b70d6f1/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-444f3884-bb92-4aa3-b074-68df6b70d6f1/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-444f3884-bb92-4aa3-b074-68df6b70d6f1/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-444f3884-bb92-4aa3-b074-68df6b70d6f1
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-444f3884-bb92-4aa3-b074-68df6b70d6f1'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b09d7893-cfc3-4fb2-bbd8-11ddda4e2683/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b09d7893-cfc3-4fb2-bbd8-11ddda4e2683/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b09d7893-cfc3-4fb2-bbd8-11ddda4e2683/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b09d7893-cfc3-4fb2-bbd8-11ddda4e2683/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b09d7893-cfc3-4fb2-bbd8-11ddda4e2683
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-b09d7893-cfc3-4fb2-bbd8-11ddda4e2683'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-36ecb1c6-b814-49ba-b1af-f411e8fe1ef0/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-36ecb1c6-b814-49ba-b1af-f411e8fe1ef0/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-36ecb1c6-b814-49ba-b1af-f411e8fe1ef0/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-36ecb1c6-b814-49ba-b1af-f411e8fe1ef0/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-36ecb1c6-b814-49ba-b1af-f411e8fe1ef0
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-36ecb1c6-b814-49ba-b1af-f411e8fe1ef0'
warnings.warn(
/home/tkloczko/rpmbuild/BUILD/cherrypy-18.9.0/cherrypy/process/wspbus.py:254: RuntimeWarning: The main thread is exiting, but the Bus is in the states.STARTED state; shutting it down automatically now. You must either call bus.block() after start(), or call bus.exit() before the main thread exits.
warnings.warn( |
I'm submitting a ...
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
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 modulesHere is pytest output:
What is the expected behavior?
pytest should not fail.
What is the motivation / use case for changing the behavior?
N/A
Please tell us about your environment:
Other information
List of modules installed in build env
The text was updated successfully, but these errors were encountered: