From aca9467fc18bca65ab625bed66ff7095753c5d44 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 6 Oct 2023 13:25:11 -0600 Subject: Fixup one test framework test [skip appveyor] Looking at wrong exceptions for possible rmdir failures Signed-off-by: Mats Wichmann --- testing/framework/TestCmdTests.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py index dc752ba..7cabf44 100644 --- a/testing/framework/TestCmdTests.py +++ b/testing/framework/TestCmdTests.py @@ -1601,10 +1601,10 @@ class rmdir_TestCase(TestCmdTestCase): try: test.rmdir(['no', 'such', 'dir']) - except EnvironmentError: + except FileNotFoundError: pass else: - raise Exception("did not catch expected SConsEnvironmentError") + raise Exception("did not catch expected FileNotFoundError") test.subdir(['sub'], ['sub', 'dir'], @@ -1616,19 +1616,19 @@ class rmdir_TestCase(TestCmdTestCase): try: test.rmdir(['sub']) - except EnvironmentError: + except OSError: pass else: - raise Exception("did not catch expected SConsEnvironmentError") + raise Exception("did not catch expected OSError") assert os.path.isdir(s_d_o), f"{s_d_o} is gone?" try: test.rmdir(['sub']) - except EnvironmentError: + except OSError: pass else: - raise Exception("did not catch expected SConsEnvironmentError") + raise Exception("did not catch expected OSError") assert os.path.isdir(s_d_o), f"{s_d_o} is gone?" @@ -1647,7 +1647,6 @@ class rmdir_TestCase(TestCmdTestCase): assert not os.path.exists(s), f"{s} exists?" - class run_TestCase(TestCmdTestCase): def test_run(self) -> None: """Test run()""" -- cgit v0.12