Ditch initial double forward slashes

This commit is contained in:
Pedro Algarvio 2017-03-08 09:46:35 +00:00
parent af7de9f0ea
commit 0a66eac8ad
No known key found for this signature in database
GPG Key ID: BB36BF6584A298FF

View File

@ -21,9 +21,12 @@ import tempfile
log = logging.getLogger(__name__)
TESTS_DIR = os.path.abspath(os.path.dirname(os.path.dirname(os.path.normpath(__file__))))
if os.name == 'nt':
TESTS_DIR = TESTS_DIR.replace('\\', '\\\\')
TESTS_DIR = os.path.dirname(os.path.dirname(os.path.normpath(os.path.abspath(__file__))))
if TESTS_DIR.startswith('//'):
# Have we been given an initial double forward slash? Ditch it!
TESTS_DIR = TESTS_DIR[1:]
if sys.platform.startswith('win'):
TESTS_DIR = os.path.normcase(TESTS_DIR)
CODE_DIR = os.path.dirname(TESTS_DIR)
INTEGRATION_TEST_DIR = os.path.join(TESTS_DIR, 'integration')