##// END OF EJS Templates
Adding test for magic warnings
Sammy Al Hashemi -
Show More
@@ -600,9 +600,16 b' class TestSystemRaw(ExitCodeChecks):'
600 try:
600 try:
601 self.system("sleep 1 # wont happen")
601 self.system("sleep 1 # wont happen")
602 except KeyboardInterrupt:
602 except KeyboardInterrupt:
603 self.fail("system call should intercept "
603 self.fail(
604 "keyboard interrupt from subprocess.call")
604 "system call should intercept "
605 self.assertEqual(ip.user_ns['_exit_code'], -signal.SIGINT)
605 "keyboard interrupt from subprocess.call"
606 )
607 self.assertEqual(ip.user_ns["_exit_code"], -signal.SIGINT)
608
609 def test_magic_warnings(self):
610 for magic_cmd in ("ls", "pip", "conda", "cd"):
611 with self.assertWarnsRegex(Warning, "You executed the system command"):
612 ip.system_raw(magic_cmd)
606
613
607 # TODO: Exit codes are currently ignored on Windows.
614 # TODO: Exit codes are currently ignored on Windows.
608 class TestSystemPipedExitCode(ExitCodeChecks):
615 class TestSystemPipedExitCode(ExitCodeChecks):
General Comments 0
You need to be logged in to leave comments. Login now