Comments (19)
oh, sorry, opened in a wrong repo. I should stop coding late. Thanks for moving it here!
from unittesting.
It should be possible by exposing the stream object to users.
from unittesting.
6708fc0 added a logger, you could use logger in your test*.py
as follows
logger = logging.getLogger('UnitTesting')
logger.setLevel(logging.DEBUG)
class TestUnitTesting(TestCase):
def test_something(self):
logger.debug("hello")
from unittesting.
looks like ST2 does not like it...
edit, 779f357 should fix it
from unittesting.
Thanks @randy3k that was fast! Are you planning to make it part of the next version in the Package Manager? Or should I just clone this repo?
from unittesting.
It is released. You should be able to upgrade it via Package Control.
from unittesting.
I guess I will have to wait some time till it becomes available through Package Control. I believe there is some lag till it is ready for the public. I have used PackageResourceViewer to verify there is still no logger present on my local machine. By the way, is there an easy way to check version of your plugin?
from unittesting.
PC has updated UnitTesting, the latest version is 0.5.9.
You can use Package Control: List Packages
to check package version.
from unittesting.
Ah, you're totally right! Thanks for your patience :)
Logging something in tests works now. Do you think it is possible to also output something that is being logged from the package under test?
from unittesting.
You can use the same logger in your package.
from unittesting.
Yes, I see this option, but my plugin has already nicely configured loggers with their specific names for each module, so in the ideal case I would still like to see them with their specific names. However, if you estimate that this is hard to do - it is not too crucial to me. Just a "nice to have" feature. Thanks anyway!
from unittesting.
You can configure your loggers such that all messages would be forward to the UnitTesting logger.
from unittesting.
The logger.getLogger("UnitTesting")
is now deprecated. A new settings capture_console
in unittesting.json will redirect the sublime console to the output stream. It is still new, use with care. :)
from unittesting.
Thanks! This sounds pretty awesome!
from unittesting.
I think the setting is wrong. It works if I use caputre_console
instead of capture_console
.
Also, it doesn't seem to capture the outputs of logging
. At least in my case. It prints the lines printed with print(...)
from unittesting.
The setting name has been fixed. It seems that logging is still using the original stdout even the the current stdout has been directed to the output stream.
from unittesting.
I have an idea how to fix it. I am out now, will fix when I get back home.
from unittesting.
fix in e3a3235.
from unittesting.
Perfect! Now it works exactly as I was dreaming 👍 Great job!
from unittesting.
Related Issues (20)
- Testing a dependency within CI HOT 7
- unittesting module named differently in 3.3/3.8 HOT 2
- Run hook on failed test
- macOS CI failing on install HOT 5
- disable CircleCi HOT 4
- sporadic macOS 11 CI failing to launch on GitHub Actions with kLSNoExecutableErr
- MacOS action hangs HOT 6
- GitHub Actions build with Ubuntu runner failing with 404 on xz-utils HOT 2
- GH actions fail to download binaries HOT 2
- GH Actions: timeout during Package Control installation HOT 9
- Ability to run single test methods or classes HOT 8
- Question: My plugin didn't generate files as it should HOT 2
- Test Current File ImportError failed to imports tests (ST4) HOT 1
- GitHub Actions macOS timeout installing Package Control HOT 3
- Coverage not generating HOT 23
- AttributeError: 'PackageManager' object has no attribute '_is_dependency'
- Coverage fails on MacOS / ST4
- ST3 regression HOT 2
- TypeError logging missing library HOT 4
- [MacOS, GithubActions]Timeout: Fail to install Package Control. HOT 2
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 unittesting.