Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(118070)

Unified Diff: Lib/distutils/tests/test_cygwinccompiler.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/distutils/tests/test_config_cmd.py ('k') | Lib/distutils/tests/test_install_lib.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/distutils/tests/test_cygwinccompiler.py Tue Mar 01 10:26:10 2016 +0200
+++ b/Lib/distutils/tests/test_cygwinccompiler.py Wed Mar 02 00:01:35 2016 +0000
@@ -1,36 +1,39 @@
"""Tests for distutils.cygwinccompiler."""
import unittest
import sys
import os
from io import BytesIO
-import subprocess
from test.support import run_unittest
-from distutils import cygwinccompiler
-from distutils.cygwinccompiler import (CygwinCCompiler, check_config_h,
- CONFIG_H_OK, CONFIG_H_NOTOK,
- CONFIG_H_UNCERTAIN, get_versions,
- get_msvcr)
+# Importing cygwinccompiler attempts to import other tools
+# that may not exist unless you're on win32.
+if sys.platform == 'win32':
+ from distutils import cygwinccompiler
+ from distutils.cygwinccompiler import (check_config_h,
+ CONFIG_H_OK, CONFIG_H_NOTOK,
+ CONFIG_H_UNCERTAIN, get_versions,
+ get_msvcr)
from distutils.tests import support
class FakePopen(object):
test_class = None
def __init__(self, cmd, shell, stdout):
self.cmd = cmd.split()[0]
exes = self.test_class._exes
if self.cmd in exes:
# issue #6438 in Python 3.x, Popen returns bytes
self.stdout = BytesIO(exes[self.cmd])
else:
self.stdout = os.popen(cmd, 'r')
+@unittest.skipUnless(sys.platform == "win32", "These tests are only for win32")
class CygwinCCompilerTestCase(support.TempdirManager,
unittest.TestCase):
def setUp(self):
super(CygwinCCompilerTestCase, self).setUp()
self.version = sys.version
self.python_h = os.path.join(self.mkdtemp(), 'python.h')
from distutils import sysconfig
« no previous file with comments | « Lib/distutils/tests/test_config_cmd.py ('k') | Lib/distutils/tests/test_install_lib.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+