Show More
@@ -546,6 +546,10 b' class ExitCodeChecks(tt.TempFileMixin):' | |||||
546 | else: |
|
546 | else: | |
547 | del os.environ['SHELL'] |
|
547 | del os.environ['SHELL'] | |
548 |
|
548 | |||
|
549 | def tearDown(self): | |||
|
550 | tt.TempFileMixin.tearDown(self) | |||
|
551 | ||||
|
552 | ||||
549 | class TestSystemRaw(unittest.TestCase, ExitCodeChecks): |
|
553 | class TestSystemRaw(unittest.TestCase, ExitCodeChecks): | |
550 | system = ip.system_raw |
|
554 | system = ip.system_raw | |
551 |
|
555 | |||
@@ -566,10 +570,16 b' class TestSystemRaw(unittest.TestCase, ExitCodeChecks):' | |||||
566 | "keyboard interrupt from subprocess.call") |
|
570 | "keyboard interrupt from subprocess.call") | |
567 | self.assertEqual(ip.user_ns['_exit_code'], -signal.SIGINT) |
|
571 | self.assertEqual(ip.user_ns['_exit_code'], -signal.SIGINT) | |
568 |
|
572 | |||
|
573 | def tearDown(self): | |||
|
574 | ExitCodeChecks.tearDown(self) | |||
|
575 | ||||
569 | # TODO: Exit codes are currently ignored on Windows. |
|
576 | # TODO: Exit codes are currently ignored on Windows. | |
570 | class TestSystemPipedExitCode(unittest.TestCase, ExitCodeChecks): |
|
577 | class TestSystemPipedExitCode(unittest.TestCase, ExitCodeChecks): | |
571 | system = ip.system_piped |
|
578 | system = ip.system_piped | |
572 |
|
579 | |||
|
580 | def tearDown(self): | |||
|
581 | ExitCodeChecks.tearDown(self) | |||
|
582 | ||||
573 | @skip_win32 |
|
583 | @skip_win32 | |
574 | def test_exit_code_ok(self): |
|
584 | def test_exit_code_ok(self): | |
575 | ExitCodeChecks.test_exit_code_ok(self) |
|
585 | ExitCodeChecks.test_exit_code_ok(self) | |
@@ -594,6 +604,9 b' class TestModules(unittest.TestCase, tt.TempFileMixin):' | |||||
594 | out = "False\nFalse\nFalse\n" |
|
604 | out = "False\nFalse\nFalse\n" | |
595 | tt.ipexec_validate(self.fname, out) |
|
605 | tt.ipexec_validate(self.fname, out) | |
596 |
|
606 | |||
|
607 | def tearDown(self): | |||
|
608 | tt.TempFileMixin.tearDown(self) | |||
|
609 | ||||
597 | class Negator(ast.NodeTransformer): |
|
610 | class Negator(ast.NodeTransformer): | |
598 | """Negates all number literals in an AST.""" |
|
611 | """Negates all number literals in an AST.""" | |
599 | def visit_Num(self, node): |
|
612 | def visit_Num(self, node): |
@@ -27,6 +27,9 b" SQLITE_NOT_AVAILABLE_ERROR = ('WARNING: IPython History requires SQLite,'" | |||||
27 | class TestFileToRun(unittest.TestCase, tt.TempFileMixin): |
|
27 | class TestFileToRun(unittest.TestCase, tt.TempFileMixin): | |
28 | """Test the behavior of the file_to_run parameter.""" |
|
28 | """Test the behavior of the file_to_run parameter.""" | |
29 |
|
29 | |||
|
30 | def tearDown(self): | |||
|
31 | tt.TempFileMixin.tearDown(self) | |||
|
32 | ||||
30 | def test_py_script_file_attribute(self): |
|
33 | def test_py_script_file_attribute(self): | |
31 | """Test that `__file__` is set when running `ipython file.py`""" |
|
34 | """Test that `__file__` is set when running `ipython file.py`""" | |
32 | src = "print(__file__)\n" |
|
35 | src = "print(__file__)\n" |
General Comments 0
You need to be logged in to leave comments.
Login now