()
| 7 | from IPython.utils.tempdir import TemporaryDirectory |
| 8 | |
| 9 | def test_logstart_inaccessible_file(): |
| 10 | try: |
| 11 | _ip.logger.logstart(logfname="/") # Opening that filename will fail. |
| 12 | except IOError: |
| 13 | pass |
| 14 | else: |
| 15 | nt.assert_true(False) # The try block should never pass. |
| 16 | |
| 17 | try: |
| 18 | _ip.run_cell("a=1") # Check it doesn't try to log this |
| 19 | finally: |
| 20 | _ip.logger.log_active = False # If this fails, don't let later tests fail |
| 21 | |
| 22 | def test_logstart_unicode(): |
| 23 | with TemporaryDirectory() as tdir: |