Comments (7)
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.
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.
@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.
yeah, of course it could be a great idea make this feature optional :)
from pytest-check.
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.
See changelog for set_failure_callback()
on version 2.1.0
from pytest-check.
@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)
- Feature request: Add new test outcome status ? HOT 1
- Test is not marked as xfailed when pytest.xfail() called after a failure. HOT 2
- RFE: is it possible to start making github releases?🤔 HOT 6
- pytest check is not reporting all failures distributed across multiple python functions or setup fixture called within a test function HOT 3
- Linux environment does not have version 2.1.5 HOT 3
- Document & test: custom error message for check.raises HOT 2
- raises match argument HOT 1
- Is the 'raises' parameter in xfail ignored? HOT 1
- `pytest-check` causes `pytest-xdist` testing to fail HOT 1
- Add new check type: match - use regular expressions to tests againgst a string HOT 1
- pytest_html HOT 1
- How to have all failure on logging pytestfile HOT 1
- [v2.2.3] ExceptionRepr creation is not compatible with pytest < 7.3. HOT 2
- INTERNALERROR after upgrading package to 2.2.3 or 2.2.4 version HOT 5
- Add an xdist test
- Incorrect arguments to `ExceptionRepr` HOT 5
- d7afe0d6570c24d8d9ecc4443be9a765a0b85c2c HOT 1
- d7afe0d6570c24d8d9ecc4443be9a765a0b85c2c
- type-hinting the project
- Include a `check.match` and `check.not_match` for regex comparison
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-check.