Fix lint in test_utils.py (#17944)
authorEdward Yang <ezyang@fb.com>
Wed, 13 Mar 2019 15:35:26 +0000 (08:35 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 13 Mar 2019 16:02:35 +0000 (09:02 -0700)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17944
ghimport-source-id: 5b45086428b5a36e737882c78f285141121fd1bc

Stack:
* **#17944 Fix lint in test_utils.py**

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Differential Revision: D14430132

fbshipit-source-id: b00de7b4c685645ad5a4dc8c5fe6ce7e1893a3eb

test/test_utils.py

index b0afba5..0c78bb8 100644 (file)
@@ -201,7 +201,7 @@ class TestCheckpoint(TestCase):
         )
 
     def test_checkpoint_rng_cpu(self):
-        for i in range(5):
+        for _ in range(5):
             inp = torch.randn(20000, device='cpu').requires_grad_()
             phase1 = torch.nn.Dropout()
             phase2 = torch.nn.Dropout()
@@ -229,7 +229,7 @@ class TestCheckpoint(TestCase):
 
     @unittest.skipIf(not HAS_CUDA, 'No CUDA')
     def test_checkpoint_rng_cuda(self):
-        for i in range(5):
+        for _ in range(5):
             inp = torch.randn(20000, device='cuda').requires_grad_()
             phase1 = torch.nn.Dropout()
             phase2 = torch.nn.Dropout()
@@ -325,7 +325,7 @@ class TestBottleneck(TestCase):
         import subprocess
         from common_utils import PY3
 
-        p = subprocess.Popen(command, stdout=subprocess.PIPE,
+        p = subprocess.Popen(command, stdout=subprocess.PIPE,  # noqa
                              stderr=subprocess.PIPE, shell=True)
         output, err = p.communicate()
         rc = p.returncode