-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
type: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Description
when i run the test case i have lot of logs which use logger and print in my testcase.. i need mechanism where i can print all the logs while its being executed on screen and capture it to a file descriptor simultaneously .
pytest -s test.py (pytest --capture=no test.py )
when I run the logs are printed to sys.stdout which is right ..
what I'm looking for is
pytest --capture=no,fd
this will ensure i can see what is happening while the test is being executed and the logs are written to the fd which is a file.
example :
$ pytest --capture=no test.py
============================================================= test session starts =============================================================
platform linux -- Python 3.4.3, pytest-3.0.7, py-1.4.32, pluggy-0.4.0
rootdir: /tmp, inifile:
collected 8 items
printing testing 123 123 123 from test..
None
.
------------------------------------------------------------- Test Summary Begin --------------------------------------------------------------
test.py::test::():: : Passed
-------------------------------------------------------------- Test Summary End ---------------------------------------------------------------
the output "printing testing 123 123 123 from test.. " need to written to file as well
dnut and ssbarneassbarnea
Metadata
Metadata
Assignees
Labels
type: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature