summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2022-11-29 08:59:39 -0700
committerMats Wichmann <mats@linux.com>2022-11-29 09:04:52 -0700
commite4f93fcf95516e3962ad2fdff236b4817ad7944c (patch)
tree60a7a713ef06757b0c3f65c61cf4fe0a6ba100a2 /testing
parent6704d0fa67a2d8d6181fb0512010bf9bd0bb7623 (diff)
downloadscons-git-e4f93fcf95516e3962ad2fdff236b4817ad7944c.tar.gz
Polish test skipping in a couple of FW tests [skip appveyor]
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r--testing/framework/TestCmdTests.py26
-rw-r--r--testing/framework/TestCommonTests.py11
2 files changed, 7 insertions, 30 deletions
diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py
index e666ac458..6489095c5 100644
--- a/testing/framework/TestCmdTests.py
+++ b/testing/framework/TestCmdTests.py
@@ -2786,16 +2786,9 @@ class subdir_TestCase(TestCmdTestCase):
class symlink_TestCase(TestCmdTestCase):
+ @unittest.skipIf(sys.platform == 'win32', "Skip symlink test on win32")
def test_symlink(self):
"""Test symlink()"""
-
- #symlinks don't work well on windows
- if sys.platform == 'win32':
- return
-
- try: os.symlink
- except AttributeError: return
-
test = TestCmd.TestCmd(workdir = '', subdir = 'foo')
wdir_file1 = os.path.join(test.workdir, 'file1')
wdir_target1 = os.path.join(test.workdir, 'target1')
@@ -3127,17 +3120,14 @@ class workpath_TestCase(TestCmdTestCase):
assert wpath == os.path.join(test.workdir, 'foo', 'bar')
-@unittest.skipIf(sys.platform == 'win32', "Don't run on win32")
class readable_TestCase(TestCmdTestCase):
def test_readable(self):
"""Test readable()"""
test = TestCmd.TestCmd(workdir = '', subdir = 'foo')
test.write('file1', "Test file #1\n")
test.write(['foo', 'file2'], "Test file #2\n")
-
- try: symlink = os.symlink
- except AttributeError: pass
- else: symlink('no_such_file', test.workpath('dangling_symlink'))
+ if hasattr(os, 'symlink') and sys.platform != 'win32':
+ symlink('no_such_file', test.workpath('dangling_symlink'))
test.readable(test.workdir, 0)
# XXX skip these tests if euid == 0?
@@ -3175,14 +3165,8 @@ class writable_TestCase(TestCmdTestCase):
test = TestCmd.TestCmd(workdir = '', subdir = 'foo')
test.write('file1', "Test file #1\n")
test.write(['foo', 'file2'], "Test file #2\n")
-
- if sys.platform != 'win32':
- try:
- symlink = os.symlink
- except AttributeError:
- pass
- else:
- symlink('no_such_file', test.workpath('dangling_symlink'))
+ if hasattr(os, 'symlink') and sys.platform != 'win32':
+ symlink('no_such_file', test.workpath('dangling_symlink'))
test.writable(test.workdir, 0)
# XXX skip these tests if euid == 0?
diff --git a/testing/framework/TestCommonTests.py b/testing/framework/TestCommonTests.py
index fe8d4cb13..6d8c27fe3 100644
--- a/testing/framework/TestCommonTests.py
+++ b/testing/framework/TestCommonTests.py
@@ -133,7 +133,6 @@ class TestCommonTestCase(unittest.TestCase):
stdout = run_env.stdout()
stderr = run_env.stderr()
- breakpoint()
expect_stdout = expect_stdout % self.__dict__
assert stdout == expect_stdout, assert_display(expect_stdout,
stdout,
@@ -979,11 +978,9 @@ class must_exist_TestCase(TestCommonTestCase):
stderr = run_env.stderr()
assert stderr == "PASSED\n", stderr
+ @unittest.skipIf(sys.platform == 'win32', "Skip symlink test on win32")
def test_broken_link(self) :
"""Test must_exist(): exists but it is a broken link"""
- if sys.platform == 'win32':
- return
-
run_env = self.run_env
script = lstrip("""\
@@ -1655,13 +1652,9 @@ class must_not_exist_TestCase(TestCommonTestCase):
stderr = run_env.stderr()
assert stderr == "PASSED\n", stderr
+ @unittest.skipIf(sys.platform == 'win32', "Skip symlink test on win32")
def test_existing_broken_link(self):
"""Test must_not_exist(): exists but it is a broken link"""
-
- # symlinks don't really work on win32
- if sys.platform == 'win32':
- return
-
run_env = self.run_env
script = lstrip("""\