Przeglądaj źródła

Fix a test that does not pass when stdin is closed

Matthew Wang 9 lat temu
rodzic
commit
bd099f3a87
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3
    1
      tests/test_cdiff.py

+ 3
- 1
tests/test_cdiff.py Wyświetl plik

753
         os.chdir(self._non_ws)
753
         os.chdir(self._non_ws)
754
         ret = cdiff.main()
754
         ret = cdiff.main()
755
         os.chdir(self._cwd)
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
     def test_read_log(self):
760
     def test_read_log(self):
759
         sys.argv = [sys.argv[0], '--log']
761
         sys.argv = [sys.argv[0], '--log']