summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-08-08 18:54:01 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-08-08 18:54:01 +0200
commitcd5e6765f2403db4f90b08a3f42841565710f65f (patch)
treee2bd3671a058794b63e82e04d05fac31bd8a7164
parent68860341da1d5e328b66e85f7fdbdc8f54748cb9 (diff)
downloadpython-apt-cd5e6765f2403db4f90b08a3f42841565710f65f.tar.gz
skip tests if sources.list is not readable
-rw-r--r--tests/test_all.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_all.py b/tests/test_all.py
index 091581f8..f7b9dc8c 100644
--- a/tests/test_all.py
+++ b/tests/test_all.py
@@ -34,6 +34,10 @@ def get_library_dir():
return os.path.abspath(library_dir)
if __name__ == '__main__':
+ if not os.access("/etc/apt/sources.list", os.R_OK):
+ sys.stderr.write("[tests] Skipping because sources.list is not readable\n")
+ sys.exit(0)
+
sys.stderr.write("[tests] Running on %s\n" % sys.version.replace("\n", ""))
dirname = os.path.dirname(__file__)
if dirname: