summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-12-11 23:01:21 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-12-11 23:01:21 (GMT)
commit63321b49780db9196742b1dec702029824faa777 (patch)
tree81e2d1b333bba8899dc1d707f5114c229e86b840 /Lib
parent50bfbb9903171c96c19359fd50fb6a5570128ef6 (diff)
parent36193e73b8d17a967f1521ce12f12271187feecb (diff)
downloadcpython-63321b49780db9196742b1dec702029824faa777.zip
cpython-63321b49780db9196742b1dec702029824faa777.tar.gz
cpython-63321b49780db9196742b1dec702029824faa777.tar.bz2
Issue #19828: Merge with 3.3
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_site.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index aab5860..2d214f4 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -6,8 +6,7 @@ executing have not been removed.
"""
import unittest
import test.support
-from test.support import run_unittest, TESTFN, EnvironmentVarGuard
-from test.support import captured_stderr
+from test.support import captured_stderr, TESTFN, EnvironmentVarGuard
import builtins
import os
import sys
@@ -19,13 +18,13 @@ import subprocess
import sysconfig
from copy import copy
-# Need to make sure to not import 'site' if someone specified ``-S`` at the
-# command-line. Detect this by just making sure 'site' has not been imported
-# already.
-if "site" in sys.modules:
- import site
-else:
- raise unittest.SkipTest("importation of site.py suppressed")
+# These tests are not particularly useful if Python was invoked with -S.
+# If you add tests that are useful under -S, this skip should be moved
+# to the class level.
+if sys.flags.no_site:
+ raise unittest.SkipTest("Python was invoked with -S")
+
+import site
if site.ENABLE_USER_SITE and not os.path.isdir(site.USER_SITE):
# need to add user site directory for tests