Giter Site home page Giter Site logo

1.5.3: pytest is failing about logbook HOT 2 CLOSED

kloczek avatar kloczek commented on September 13, 2024
1.5.3: pytest is failing

from logbook.

Comments (2)

kloczek avatar kloczek commented on September 13, 2024

pytest seems still is failing but now I have onlty one failing unit

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-logbook-1.5.3-9.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-logbook-1.5.3-9.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
824545:C 13 Jan 2022 14:00:57.469 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
824545:C 13 Jan 2022 14:00:57.469 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=824545, just started
824545:C 13 Jan 2022 14:00:57.469 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
824545:M 13 Jan 2022 14:00:57.470 * Increased maximum number of open files to 10032 (it was originally set to 1024).
824545:M 13 Jan 2022 14:00:57.470 * monotonic clock: POSIX clock_gettime
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 6.2.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 824545
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           https://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

824545:M 13 Jan 2022 14:00:57.471 # Server initialized
824545:M 13 Jan 2022 14:00:57.472 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
824545:M 13 Jan 2022 14:00:57.473 * Ready to accept connections
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/logbook-1.5.3
collected 213 items

tests/test_asyncio.py .                                                                                                                                              [  0%]
tests/test_ci.py ss                                                                                                                                                  [  1%]
tests/test_deadlock.py .                                                                                                                                             [  1%]
tests/test_file_handler.py ................................                                                                                                          [ 16%]
tests/test_fingers_crossed_handler.py ......                                                                                                                         [ 19%]
tests/test_flags.py ..                                                                                                                                               [ 20%]
tests/test_groups.py ..                                                                                                                                              [ 21%]
tests/test_handler_errors.py ...                                                                                                                                     [ 23%]
tests/test_handlers.py ...........                                                                                                                                   [ 28%]
tests/test_helpers.py ..                                                                                                                                             [ 29%]
tests/test_log_record.py ..........                                                                                                                                  [ 33%]
tests/test_logbook.py ...                                                                                                                                            [ 35%]
tests/test_logger.py ...                                                                                                                                             [ 36%]
tests/test_logging_api.py .............                                                                                                                              [ 42%]
tests/test_logging_compat.py ....                                                                                                                                    [ 44%]
tests/test_logging_times.py ss...                                                                                                                                    [ 46%]
tests/test_mail_handler.py .......                                                                                                                                   [ 50%]
tests/test_more.py .........sss                                                                                                                                      [ 55%]
tests/test_nteventlog_handler.py s                                                                                                                                   [ 56%]
tests/test_null_handler.py ......                                                                                                                                    [ 59%]
tests/test_processors.py ....                                                                                                                                        [ 61%]
tests/test_queues.py .........s....                                                                                                                                  [ 67%]
tests/test_syslog_handler.py ............                                                                                                                            [ 73%]
tests/test_test_handler.py ..............................                                                                                                            [ 87%]
tests/test_ticketing.py F                                                                                                                                            [ 87%]
tests/test_unicode.py .......                                                                                                                                        [ 91%]
tests/test_utils.py ...................                                                                                                                              [100%]

================================================================================= FAILURES =================================================================================
___________________________________________________________________________ test_basic_ticketing ___________________________________________________________________________

logger = <logbook.base.Logger object at 0x7f75f9821a00>

    @pytest.mark.xfail(
        os.name == 'nt' and (python_version == (3, 2) or python_version == (3, 3)),
        reason='Problem with in-memory sqlite on Python 3.2, 3.3 and Windows')
    @require_module('sqlalchemy')
    def test_basic_ticketing(logger):
        from logbook.ticketing import TicketingHandler
        from time import sleep
        with TicketingHandler('sqlite:///') as handler:
            for x in xrange(5):
                logger.warn('A warning')
                sleep(0.2)
                logger.info('An error')
                sleep(0.2)
                if x < 2:
                    try:
                        1 / 0
                    except Exception:
                        logger.exception()

>       assert handler.db.count_tickets() == 3

tests/test_ticketing.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <logbook.ticketing.SQLAlchemyBackend object at 0x7f75f98211c0>

    def count_tickets(self):
        """Returns the number of tickets."""
>       return self.engine.execute(self.tickets.count()).fetchone()[0]
E       AttributeError: 'Table' object has no attribute 'count'

logbook/ticketing.py:246: AttributeError
============================================================================= warnings summary =============================================================================
tests/test_queues.py::test_missing_zeromq
  /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <function ZeroMQHandler.__del__ at 0x7f75f9771940>

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILD/logbook-1.5.3/logbook/queues.py", line 241, in __del__
      self.close(linger=100)
    File "/home/tkloczko/rpmbuild/BUILD/logbook-1.5.3/logbook/queues.py", line 232, in close
      self.socket.close(linger)
  AttributeError: 'ZeroMQHandler' object has no attribute 'socket'

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

tests/test_ticketing.py::test_basic_ticketing
  /home/tkloczko/rpmbuild/BUILD/logbook-1.5.3/logbook/ticketing.py:147: SADeprecationWarning: The create_engine.convert_unicode parameter and corresponding dialect-level parameters are deprecated, and will be removed in a future release.  Modern DBAPIs support Python Unicode natively and this parameter is unnecessary.
    self.engine = create_engine(engine_or_uri, convert_unicode=True,

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_ci.py:8: AppVeyor CI test
SKIPPED [1] tests/test_ci.py:16: Travis CI test
SKIPPED [2] tests/test_logging_times.py:35: Cannot test utc/localtime differences if they vary by less than one minute...
SKIPPED [1] tests/test_more.py:166: Module riemann_client is required
SKIPPED [1] tests/test_more.py:189: Module riemann_client is required
SKIPPED [1] tests/test_more.py:195: Module riemann_client is required
SKIPPED [1] tests/test_nteventlog_handler.py:9: Don't clutter NT Event Log unless enabled.
SKIPPED [1] tests/test_queues.py:166: Module execnet is required
FAILED tests/test_ticketing.py::test_basic_ticketing - AttributeError: 'Table' object has no attribute 'count'
========================================================== 1 failed, 203 passed, 9 skipped, 2 warnings in 13.95s ===========================================================

from logbook.

RazerM avatar RazerM commented on September 13, 2024

Resolved by #331

from logbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.