Show More
|
1 | NO CONTENT: modified file |
@@ -1,19 +1,31 b'' | |||
|
1 | 1 | """Test IPython.core.logger""" |
|
2 | 2 | |
|
3 | import os.path | |
|
4 | ||
|
3 | 5 | import nose.tools as nt |
|
6 | from IPython.utils.tempdir import TemporaryDirectory | |
|
4 | 7 | |
|
5 | 8 | _ip = get_ipython() |
|
6 | 9 | |
|
7 | 10 | def test_logstart_inaccessible_file(): |
|
8 | 11 | try: |
|
9 | 12 | _ip.logger.logstart(logfname="/") # Opening that filename will fail. |
|
10 | 13 | except IOError: |
|
11 | 14 | pass |
|
12 | 15 | else: |
|
13 | 16 | nt.assert_true(False) # The try block should never pass. |
|
14 | 17 | |
|
15 | 18 | try: |
|
16 | 19 | _ip.run_cell("a=1") # Check it doesn't try to log this |
|
17 | 20 | finally: |
|
18 | 21 | _ip.logger.log_active = False # If this fails, don't let later tests fail |
|
19 | 22 | |
|
23 | def test_logstart_unicode(): | |
|
24 | with TemporaryDirectory() as tdir: | |
|
25 | logfname = os.path.join(tdir, "test_unicode.log") | |
|
26 | _ip.run_cell("'abc€'") | |
|
27 | try: | |
|
28 | _ip.magic("logstart -to %s" % logfname) | |
|
29 | _ip.run_cell("'abc€'") | |
|
30 | finally: | |
|
31 | _ip.logger.logstop() |
General Comments 0
You need to be logged in to leave comments.
Login now