Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 87bc092

Browse files
committed
Convert test/script.py to py3.6
1 parent f8fc1aa commit 87bc092

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

test/chromium.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [ "$1" == "--justrun" ]; then
2525

2626
PROFILE_DIRECTORY="$(mktemp -d)"
2727
trap 'rm -r "$PROFILE_DIRECTORY"' EXIT
28-
28+
2929
# Chromium package name is 'chromium' in Debian 7 (wheezy) and other distros like Arch
3030
BROWSER="chromium-browser"
3131
which $BROWSER || BROWSER="chromium"
@@ -37,5 +37,5 @@ else
3737
./make.sh
3838
echo "running tests"
3939
CRX_NAME="`ls -tr pkg/*.crx | tail -1`"
40-
$XVFB_RUN python2.7 test/script.py Chrome $CRX_NAME
40+
$XVFB_RUN python3.6 test/script.py Chrome $CRX_NAME
4141
fi

test/firefox.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ else
5858

5959
PATH=/home/user/geckodriver:$PATH
6060
if [ -n "$FIREFOX" ]; then
61-
$XVFB_RUN python2.7 test/script.py Firefox "$PROFILE_DIRECTORY" $FIREFOX
61+
$XVFB_RUN python3.6 test/script.py Firefox "$PROFILE_DIRECTORY" $FIREFOX
6262
else
63-
$XVFB_RUN python2.7 test/script.py Firefox "$PROFILE_DIRECTORY"
63+
$XVFB_RUN python3.6 test/script.py Firefox "$PROFILE_DIRECTORY"
6464
fi
6565
fi

test/script.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class bcolors:
4949
error = e.__str__()
5050

5151
if "executable needs to be in PATH" in e.__str__():
52-
print "ChromeDriver isn't installed. Check test/chromium/README.md " \
53-
"for instructions on how to install ChromeDriver"
52+
print("ChromeDriver isn't installed. Check test/chromium/README.md " \
53+
"for instructions on how to install ChromeDriver")
5454

5555
sys.exit(2)
5656
else:
@@ -68,8 +68,8 @@ class bcolors:
6868
error = e.__str__()
6969

7070
if "executable needs to be in PATH" in e.__str__():
71-
print "GeckoDriver isn't installed. Check test/firefox/README.md " \
72-
"for instructions on how to install GeckoDriver"
71+
print("GeckoDriver isn't installed. Check test/firefox/README.md " \
72+
"for instructions on how to install GeckoDriver")
7373

7474
sys.exit(2)
7575
else:
@@ -78,18 +78,18 @@ class bcolors:
7878
# Allow the extension time to load
7979
time.sleep(1)
8080

81-
print ''
81+
print('')
8282

8383
driver.get('http://freerangekitten.com')
8484

8585
test_failed = False
8686
if driver.current_url.startswith('https'):
87-
print bcolors.OKGREEN + sys.argv[1] + ": HTTP to HTTPS redirection successful" + bcolors.ENDC
87+
print(bcolors.OKGREEN + sys.argv[1] + ": HTTP to HTTPS redirection successful" + bcolors.ENDC)
8888
elif driver.current_url.startswith('http'):
89-
print bcolors.FAIL + sys.argv[1] + ": HTTP to HTTPS redirection failed" + bcolors.ENDC
89+
print(bcolors.FAIL + sys.argv[1] + ": HTTP to HTTPS redirection failed" + bcolors.ENDC)
9090
test_failed = True
9191

92-
print ''
92+
print('')
9393

9494
driver.quit()
9595

0 commit comments

Comments
 (0)