Git Product home page Git Product logo

Comments (6)

gabor-boros avatar gabor-boros commented on June 2, 2024 1

@grandquista @mehaase Can we close this issue?

from rethinkdb-python.

mehaase avatar mehaase commented on June 2, 2024

The first issue is resolve in this commit (now on master): 96b991c

But the second and third issues are not resolved. What do you think @gabor-boros @grandquista?

from rethinkdb-python.

asakatida avatar asakatida commented on June 2, 2024

I will look at removing the call for the second issue. The third is a symptom of trying to get a handle on how exceptions were used internally. When we started this refactor there were a number of places that swallowed all exceptions. Or simply caught a re raised.

Sent with GitHawk

from rethinkdb-python.

asakatida avatar asakatida commented on June 2, 2024

The second issue is solved. At the same time I namespaced our logger to help moving forward. For the third I think we want to ensure all our logging is done at the DEBUG level. I'm basing this on Django where turning up to that level gets me all the Postgres events. Write to console is mostly for ease of testing. It could be replaced with a good set of mock utilities.

from rethinkdb-python.

mehaase avatar mehaase commented on June 2, 2024

Thanks @grandquista for working on the second issue!

For the third I think we want to ensure all our logging is done at the DEBUG level.

Agreed.

Write to console is mostly for ease of testing. It could be replaced with a good set of mock utilities.

Can you explain this a bit more? Pytest will automatically display log messages for all failing test cases. Here's an example:

import logging

logger = logging.getLogger()

def test_always_passes():
    logger.debug('this test always passes')
    assert True

def test_always_fails():
    logger.debug('this test always fails')
    assert False

Pytest can be configured to display debug logs:

> pytest test_foo.py --log-level debug
============================ test session starts ============================
platform linux -- Python 3.6.7, pytest-4.2.0, py-1.8.0, pluggy-0.9.0
rootdir: /home/mhaase/code/hyperiongray/rethinkdb-python, inifile: setup.cfg
plugins: cov-2.6.1
collected 2 items                                                                                                         

test_foo.py .F                                                         [100%]

================================= FAILURES ==================================
_____________________________ test_always_fails _____________________________

    def test_always_fails():
        logger.debug('this test always fails')
>       assert False
E       assert False

test_foo.py:11: AssertionError
----------------------------- Captured log call -----------------------------
test_foo.py                 10 DEBUG    this test always fails
===================== 1 failed, 1 passed in 0.03 seconds ====================

Or did I misunderstand the comment about testing?

from rethinkdb-python.

asakatida avatar asakatida commented on June 2, 2024

Can you explain this a bit more?

As you mentioned, only for failing cases. Sometimes output from successful tests was important.

It is mostly an internal duplication of tee, and was helpful during large scale refactoring.

from rethinkdb-python.

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.