Module and class headings are to late on stdout
See original GitHub issueI would name line #4 the module heading and line #5 the class heading
The output from line 2 & 3 comes from the setUpClass()
method.
I would assume that the heading for module is print to stdout before setUpModul()
is called and the heading for the class before the call of setUpClass()
.
What do you think?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
stylegan2-ada-pytorch/util.py at main - GitHub
"""Convenience class that behaves like a dict but allows access with the attribute ... """Redirect stderr to stdout, optionally print stdout to a...
Read more >python - Intercepting assignments to sys.stdout and sys.stderr
This works as expected - at any time after my module is imported, trying to do anything with sys.stdout or sys.stderr goes through...
Read more >Standard Output in Java: Definition & Examples - Study.com
The standard output in Java is the PrintStream class accessed through the System.out field. By default, standard output prints to the display, ...
Read more >1. Extending Python with C or C++ — Python 3.11.1 ...
We discuss the use of PyMODINIT_FUNC as a function return type later in this sample. The spam.error exception can be raised in your...
Read more >Python Tutorial - File and Text Processing
File Input/Output. File Input/Ouput (IO) requires 3 steps: Open the file for read or write or both. Read/Write data. Close the file to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I finished my investigation. Green has never supported capturing output from module/class setups or teardowns, despite me thinking I had implemented that. Though I would like to add this as a feature, it is extremely difficult and I am not planning on taking it on. If someone would like to give it a try, I’d be happy to collaborate on a pull request. The place to start is
green/suite.py
inGreenTestSuite.run
.The workaround is: Don’t write to stdout/stderr in class/module setups or teardowns.
I updated the documentation for
-a/--allow-stdout
to point out that we only capture output for tests, not setups and teardowns.No problem! Sorry I couldn’t provide a more satisfying response in this instance. This is the drawback of hitching Green to
unittest
– having to deal with it’s internal implementation. On the other hand, there’s no barrier to using Green nor any “vendor lock-in”. Always tradeoffs!