Closed jklynch closed 4 years ago
Merging #73 into master will increase coverage by
0.85%
. The diff coverage is84.21%
.
@@ Coverage Diff @@
## master #73 +/- ##
==========================================
+ Coverage 52.16% 53.02% +0.85%
==========================================
Files 11 13 +2
Lines 692 711 +19
==========================================
+ Hits 361 377 +16
- Misses 331 334 +3
Impacted Files | Coverage Δ | |
---|---|---|
nslsii/__init__.py | 5.83% <0%> (-0.15%) |
:arrow_down: |
nslsii/tests/test_logutils.py | 100% <100%> (ø) |
|
nslsii/common/ipynb/logutils.py | 100% <100%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 637177d...d3b01da. Read the comment docs.
Could you also add a call to this to base_config
?
I added some ipython driven tests in https://github.com/bluesky/bluesky/pull/1242/files.
You can do something like
from mock import MagicMock
ip = IPython.core.interactiveshell.InteractiveShell()
ip.logger = MagicMock()
ip.set_custom_exc((BaseException, ), log_exception)
ip.run_cell("raise Exception")
assert ip.logger.log_wirte.call_count > 0
added a test
It's good to have a test. We can use it as an example in the future.
This PR adds one module with one function for logging exceptions to the IPython log file.
The new module is nslsii.common.ipynb.logutils. Should it be in nslsii.common instead?
Also, is there a way to write tests against IPython?