Given following log snippets, their explanation, and nothing else, explain what failure, if any, occurred during build of this package.

  Snippets are in a format of [X] : [Y], where [X] is a log snippet, and [Y] is the explanation.

  Snippets are delimited with '================'.

  Drawing on information from all snippets, provide a concise explanation of the issue and recommend a solution.

  Explanation of the issue, and recommended solution, should take a handful of sentences.

  Snippets:

  [
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.1fyr]: [The failure happens in the %check section.]
=============
[Errors while running CTest]: [The command that fails with non-zero exit status is `ctest`, so this is a CMake-based test-suite failure.]
=============
[1: Test command: /usr/bin/python3 "-m" "unittest" "discover" "-s" "tests" "-t" "/builddir/build/BUILD/dnf-4.18.2"]: [The first-cmake test failed, which is a transitive call to Python unittests.]
=============
[1: ....History database cannot be created, using in-memory database instead: SQLite error on "/tmp/tests/history.sqlite": Open failed: unable to open database file
1: ......History database cannot be created, using in-memory database instead: SQLite error on "/tmp/tests/history.sqlite": Open failed: unable to open database file
1: E..History database cannot be created, using in-memory database instead: SQLite error on "/tmp/tests/history.sqlite": Open failed: unable to open database file
1: .History database cannot be created, using in-memory database instead: SQLite error on "/tmp/tests/history.sqlite": Open failed: unable to open database file
1: .History database cannot be created, using in-memory database instead: SQLite error on "/tmp/tests/history.sqlite": Open failed: unable to open database file
1: ...History database cannot be created, using in-memory database instead: SQLite error on "/tmp/tests/history.sqlite": Open failed: unable to open database file
1: .History database cannot be created, using in-memory database instead: SQLite error on "/tmp/tests/history.sqlite": Open failed: unable to open database file
1: .History database cannot be created, using in-memory database instead: SQLite error on "/tmp/tests/history.sqlite": Open failed: unable to open database file]: [At least one of the python test-cases failed.  See the `E` (meaning error).]
=============
[1: ERROR: test_do_transaction (tests.api.test_dnf_base.DnfBaseApiTest.test_do_transaction)
1: ----------------------------------------------------------------------
1: Traceback (most recent call last):
1:   File "/builddir/build/BUILD/dnf-4.18.2/tests/api/test_dnf_base.py", line 174, in test_do_transaction
1:     self.base.do_transaction(display=None)
1:   File "/builddir/build/BUILD/dnf-4.18.2/dnf/base.py", line 951, in do_transaction
1:     self._moduleContainer.save()
1:   File "/usr/lib64/python3.12/site-packages/libdnf/module.py", line 1241, in save
1:     return _module.ModulePackageContainer_save(self)
1:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1: libdnf._error.Error: Failed to create directory "/etc/dnf/modules.d": 13 - Permission denied]: [Here you can see the actual test failure.]

Issue: Because the Python testsuite, triggered by CMake testsuite, executed in %check phase failed.
Resolution: Fix the testsuite. This could mean anything; fixing the test-case (if broken) or fixing the code (so the test-case reveals a real bug).