瀏覽代碼

Fix a test that does not pass when stdin is closed

Matthew Wang 8 年之前
父節點
當前提交
bd099f3a87
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. 3
    1
      tests/test_cdiff.py

+ 3
- 1
tests/test_cdiff.py 查看文件

@@ -753,7 +753,9 @@ class MainTest(unittest.TestCase):
753 753
         os.chdir(self._non_ws)
754 754
         ret = cdiff.main()
755 755
         os.chdir(self._cwd)
756
-        self.assertNotEqual(ret, 0)
756
+        # Travis now runs tests with stdin closed
757
+        if sys.stdin.isatty():
758
+            self.assertNotEqual(ret, 0)
757 759
 
758 760
     def test_read_log(self):
759 761
         sys.argv = [sys.argv[0], '--log']