##// END OF EJS Templates
Swap base class instead of redefinign the tearDown method
Matthias Bussonnier -
Show More
@@ -546,11 +546,8 b' class ExitCodeChecks(tt.TempFileMixin):'
546 546 else:
547 547 del os.environ['SHELL']
548 548
549 def tearDown(self):
550 tt.TempFileMixin.tearDown(self)
551
552 549
553 class TestSystemRaw(unittest.TestCase, ExitCodeChecks):
550 class TestSystemRaw(ExitCodeChecks, unittest.TestCase):
554 551 system = ip.system_raw
555 552
556 553 @onlyif_unicode_paths
@@ -570,16 +567,10 b' class TestSystemRaw(unittest.TestCase, ExitCodeChecks):'
570 567 "keyboard interrupt from subprocess.call")
571 568 self.assertEqual(ip.user_ns['_exit_code'], -signal.SIGINT)
572 569
573 def tearDown(self):
574 ExitCodeChecks.tearDown(self)
575
576 570 # TODO: Exit codes are currently ignored on Windows.
577 class TestSystemPipedExitCode(unittest.TestCase, ExitCodeChecks):
571 class TestSystemPipedExitCode(ExitCodeChecks, unittest.TestCase):
578 572 system = ip.system_piped
579 573
580 def tearDown(self):
581 ExitCodeChecks.tearDown(self)
582
583 574 @skip_win32
584 575 def test_exit_code_ok(self):
585 576 ExitCodeChecks.test_exit_code_ok(self)
@@ -592,7 +583,7 b' class TestSystemPipedExitCode(unittest.TestCase, ExitCodeChecks):'
592 583 def test_exit_code_signal(self):
593 584 ExitCodeChecks.test_exit_code_signal(self)
594 585
595 class TestModules(unittest.TestCase, tt.TempFileMixin):
586 class TestModules(tt.TempFileMixin, unittest.TestCase):
596 587 def test_extraneous_loads(self):
597 588 """Test we're not loading modules on startup that we shouldn't.
598 589 """
@@ -604,9 +595,6 b' class TestModules(unittest.TestCase, tt.TempFileMixin):'
604 595 out = "False\nFalse\nFalse\n"
605 596 tt.ipexec_validate(self.fname, out)
606 597
607 def tearDown(self):
608 tt.TempFileMixin.tearDown(self)
609
610 598 class Negator(ast.NodeTransformer):
611 599 """Negates all number literals in an AST."""
612 600 def visit_Num(self, node):
@@ -24,12 +24,9 b" sqlite_err_maybe = dec.module_not_available('sqlite3')"
24 24 SQLITE_NOT_AVAILABLE_ERROR = ('WARNING: IPython History requires SQLite,'
25 25 ' your history will not be saved\n')
26 26
27 class TestFileToRun(unittest.TestCase, tt.TempFileMixin):
27 class TestFileToRun(tt.TempFileMixin, unittest.TestCase):
28 28 """Test the behavior of the file_to_run parameter."""
29 29
30 def tearDown(self):
31 tt.TempFileMixin.tearDown(self)
32
33 30 def test_py_script_file_attribute(self):
34 31 """Test that `__file__` is set when running `ipython file.py`"""
35 32 src = "print(__file__)\n"
General Comments 0
You need to be logged in to leave comments. Login now