summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-08-08 18:55:44 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-08-08 18:55:44 +0200
commitcf6cbda23e3b78beb6ce2ef84c5445200b1dfc08 (patch)
treea9c73aacaab37cae8c8c28d77f819e9092a7cf1d /tests
parent4ac62e28a844ff17c40c50eb16625baeb116a1c1 (diff)
downloadpython-apt-cf6cbda23e3b78beb6ce2ef84c5445200b1dfc08.tar.gz
disable tests if /etc/apt/sources.list is not readable
Diffstat (limited to 'tests')
-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: