def test_disk_partitions(self):
        for disk in psutil.disk_partitions(all=False):
            assert os.path.exists(disk.device), disk
            assert os.path.isdir(disk.mountpoint), disk
            assert disk.fstype, disk
            assert isinstance(disk.opts, str)
        for disk in psutil.disk_partitions(all=True):
            if not WINDOWS:
                try:
                    os.stat(disk.mountpoint)
                except OSError:
                    # http://mail.python.org/pipermail/python-dev/2012-June/120787.html
                    err = sys.exc_info()[1]
                    if (errno.EPERM, errno.EACCES) not in err.errno:
                        raise
                else:
                    assert os.path.isdir(disk.mountpoint), disk.mountpoint
            assert isinstance(disk.fstype, str)
            assert isinstance(disk.opts, str)

        def find_mount_point(path):
            path = os.path.abspath(path)
            while not os.path.ismount(path):
                path = os.path.dirname(path)
            return path

        mount = find_mount_point(__file__)
        mounts = [x.mountpoint for x in psutil.disk_partitions(all=True)]
        self.assertIn(mount, mounts)
        psutil.disk_usage(mount)
dataset/ETHPy150Open packages/psutil/test/test_psutil.py/TestCase.test_disk_partitions/swapped operands of `not in`