VirtualBox

Ignore:
Timestamp:
Nov 24, 2022 11:46:15 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154728
Message:

Validation Kit: Fixed lots of warnings, based on pylint 2.12.2.

Location:
trunk/src/VBox/ValidationKit/tests
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py

    r97593 r97673  
    152152                          % (uuid.uuid4(), self.sVBoxValidationKitIso, sGaIso);
    153153            reporter.log2('Using VISO combining ValKit and GAs "%s": %s' % (sVisoContent, sGaViso));
    154             with open(sGaViso, 'w') as oGaViso:
     154            with open(sGaViso, 'w') as oGaViso: # pylint: disable=unspecified-encoding
    155155                oGaViso.write(sVisoContent);
    156156            sGaIso = sGaViso;
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r97604 r97673  
    33533353                                                         args = (oGuestProcess,),
    33543354                                                         name = ('threadForTestGuestCtrlSessionReboot'));
    3355                         oThreadReboot.setDaemon(True);
     3355                        oThreadReboot.setDaemon(True); # pylint: disable=deprecated-method
    33563356                        oThreadReboot.start();
    33573357
     
    43124312                oFile.setSize(64);
    43134313                fUseFallback = False;
    4314             except Exception as oXcpt:
     4314            except:
    43154315                reporter.logXcpt();
    43164316
     
    43234323                    try:
    43244324                        oFile.setSize(cbBigFile);
    4325                     except Exception as oXcpt:
     4325                    except Exception:
    43264326                        reporter.logXcpt('cbBigFile=%s' % (sBigPath,));
    43274327                        try:
  • trunk/src/VBox/ValidationKit/tests/api/tdPython1.py

    r96407 r97673  
    176176                try:
    177177                    oThread = threading.Thread(target=self.interruptWaitEventsThreadProc);
    178                     oThread.setDaemon(False);
     178                    oThread.setDaemon(False); # pylint: disable=deprecated-method
    179179                except:
    180180                    reporter.errorXcpt();
  • trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py

    r96407 r97673  
    13181318        oSet.aoTestVms.extend([oTestVm for oTestVm in self.asTestVmClasses.values() if oTestVm is not None]);
    13191319        sOs = self.getBuildOs();
    1320         if sOs in self.asTestVmClasses.keys():
     1320        if sOs in self.asTestVmClasses:
    13211321            for oTestVM in oSet.aoTestVms:
    13221322                if oTestVM is not None:
  • trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsInstOs2.py

    r96407 r97673  
    206206
    207207        # Set extra data
    208         if self.asExtraData != []:
     208        if self.asExtraData:
    209209            for sExtraData in self.asExtraData:
    210210                try:
  • trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsUnattendedInst1.py

    r96407 r97673  
    269269            eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnlyNetwork;
    270270
    271         return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage);
     271        return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage); # pylint: disable=protected-access
    272272
    273273
     
    322322                return True;
    323323
    324         return vboxtestvms.BaseTestVm._skipVmTest(self, oTestDrv, oVM);
     324        return vboxtestvms.BaseTestVm._skipVmTest(self, oTestDrv, oVM); # pylint: disable=protected-access
     325
    325326
    326327    def getReconfiguredVm(self, oTestDrv, cCpus, sVirtMode, sParavirtMode = None):
  • trunk/src/VBox/ValidationKit/tests/storage/tdStorageRawDrive1.py

    r96407 r97673  
    10861086                    sKey = oMatch.group(1).strip();
    10871087                    sValue = oMatch.group(2).strip();
    1088                     if sKey not in asHeader.keys():
     1088                    if sKey not in asHeader:
    10891089                        return reporter.error("VMDK descriptor has invalid format");
    10901090                    sDictValue = asHeader[sKey];
     
    11221122                sKey = oMatch.group(1).strip();
    11231123                sValue = oMatch.group(2).strip();
    1124                 if sKey not in asDatabase.keys():
     1124                if sKey not in asDatabase:
    11251125                    return reporter.error("VMDK descriptor has invalid format");
    11261126                sDictValue = asDatabase[sKey];
     
    11901190                            reporter.error('Download vmdktest.vmdk from guest to host failed');
    11911191                        else:
    1192                             with open(sDstFile) as oFile:
     1192                            with open(sDstFile) as oFile: # pylint: disable=unspecified-encoding
    11931193                                asDescriptor = [row.strip() for row in oFile];
    11941194                            if not asDescriptor:
     
    15791579        oSet.aoTestVms.extend([oTestVm for oTestVm in self.asTestVmClasses.values() if oTestVm is not None]);
    15801580        sOs = self.getBuildOs();
    1581         if sOs in self.asTestVmClasses.keys():
     1581        if sOs in self.asTestVmClasses:
    15821582            for oTestVM in oSet.aoTestVms:
    15831583                if oTestVM is not None:
  • trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py

    r97488 r97673  
    11571157        # Open /dev/null for use as stdin further down.
    11581158        try:
    1159             oDevNull = open(os.path.devnull, 'w+');             # pylint: disable=consider-using-with
     1159            oDevNull = open(os.path.devnull, 'w+');             # pylint: disable=consider-using-with,unspecified-encoding
    11601160        except:
    11611161            oDevNull = None;
  • trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py

    r96407 r97673  
    563563        self.aTaskArgs      = aArgs;
    564564        self.oThread        = threading.Thread(target=self.taskThread, args=(), name=('UTS-%s' % (sStatus)));
    565         self.oThread.setDaemon(True);
     565        self.oThread.setDaemon(True); # pylint: disable=deprecated-method
    566566        self.msStart        = base.timestampMilli();
    567567
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette