Code Monkey home page Code Monkey logo

Comments (7)

okken avatar okken commented on May 23, 2024 1

This is a nice feature. I'd like to look into it.
It needs to add real-time logging without duplicating the overall error report.

from pytest-check.

okken avatar okken commented on May 23, 2024 1

What do you think about this option?
We could add the flag --log-check-level and maybe the setting log_check_level, defaulting to NOTSET.
And if set, the failures are logged.
This would add real time logging support, but not change the default behavior.

from pytest-check.

okken avatar okken commented on May 23, 2024 1

@kapis90 I understand the request.
I also understand the want. It's really a separate request, I think, from the original want.
PR #115 solves the original issue, hopefully, but doesn't address the pass logging.

I've added #116 for your request.

from pytest-check.

jaimedelreyg avatar jaimedelreyg commented on May 23, 2024

yeah, of course it could be a great idea make this feature optional :)

from pytest-check.

kapis90 avatar kapis90 commented on May 23, 2024

I would add something else on my side. It would be wonderful to have logged the passes as well (optionally ofc)
Here is a sample output:

test_sandbox.py::TestSandbox::test_case1 
------------------------------- live log setup --------------------------------
13:17:04.319 [INFO] INIT
-------------------------------- live log call --------------------------------
13:17:04.320 [FAIL] check 2 == 1 FAIL1
13:17:04.853 [PASS] check 1 == 1 PASS
13:17:04.854 [FAIL] check 0 == 1 FAIL2
FAILED                                                                   [100%]
testsuites\sandbox_test\test_sandbox.py:42 (TestSandbox.test_case1)
FAILURE: check 2 == 1: FAIL1
test_sandbox.py:44 in test_case1() -> self.steps.step_check()
scripts\steps.py:25 in step_check() -> check.equal(2, 1, "FAIL1")

FAILURE: check 0 == 1: FAIL2
test_sandbox.py:44 in test_case1() -> self.steps.step_check()
scripts\steps.py:27 in step_check() -> check.equal(0, 1, "FAIL2")

------------------------------------------------------------
Failed Checks: 2

What I did, I added two logging levels (PASS and FAIL) and just log them with message.
I think adding different log levels should not be a problem. I can create them on root logger in my project, and just specify them from command line as you suggest

Why I even need a pass in test case?
Well, I am using pytest for functional tests in my project, after execution I need to create a report what was tested. Having this in log will simplify the process

@okken, does it make sense ?

from pytest-check.

okken avatar okken commented on May 23, 2024

See changelog for set_failure_callback() on version 2.1.0

from pytest-check.

kapis90 avatar kapis90 commented on May 23, 2024

@kapis90 I understand the request. I also understand the want. It's really a separate request, I think, from the original want. PR #115 solves the original issue, hopefully, but doesn't address the pass logging.

I've added #116 for your request.

I agree with you, it can be treated as separate issue

from pytest-check.

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.