Skip to content

Commit bf7e3d2

Browse files
committed
gh-154726: Group shutil special-file symlink tests
1 parent 2fb2134 commit bf7e3d2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/test_shutil.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,11 @@ def _check_copyfile_symlink_to_special_file(self, target):
15851585
self.assertTrue(os.path.islink(dst))
15861586
self.assertEqual(os.readlink(dst), target)
15871587

1588+
@os_helper.skip_unless_symlink
1589+
@unittest.skipUnless(os.path.exists('/dev/null'), 'requires /dev/null')
1590+
def test_copyfile_symlink_to_character_device(self):
1591+
self._check_copyfile_symlink_to_special_file('/dev/null')
1592+
15881593
@os_helper.skip_unless_symlink
15891594
@unittest.skipUnless(hasattr(os, "mkfifo"), 'requires os.mkfifo()')
15901595
@unittest.skipIf(sys.platform == "vxworks",
@@ -1619,11 +1624,6 @@ def test_copyfile_character_device(self):
16191624
self.assertRaisesRegex(shutil.SpecialFileError, 'is a character device',
16201625
shutil.copyfile, src_file, '/dev/null')
16211626

1622-
@os_helper.skip_unless_symlink
1623-
@unittest.skipUnless(os.path.exists('/dev/null'), 'requires /dev/null')
1624-
def test_copyfile_symlink_to_character_device(self):
1625-
self._check_copyfile_symlink_to_special_file('/dev/null')
1626-
16271627
def test_copyfile_block_device(self):
16281628
block_dev = None
16291629
for dev in ['/dev/loop0', '/dev/sda', '/dev/vda', '/dev/disk0']:

0 commit comments

Comments
 (0)