Skip to content

Commit

Permalink
Implement support for 'squishrunner execution' and 'Squish as a modul…
Browse files Browse the repository at this point in the history
…e' (#33)

* Implement support for execution from both squishrunner and as a module

* Remove dependency on SQUISHRUNNER_HOST and SQUISHRUNNER_PORT

Replace environment variables check with try-except block to catch the ImportError
  • Loading branch information
Eduard authored Jul 4, 2023
1 parent 2ba2b10 commit 17e47d7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
6 changes: 5 additions & 1 deletion squape/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
# LICENSE file in the root directory of this source tree.
from contextlib import contextmanager

import squish
try:
import squish
except ImportError:
import squishtest as squish

import test


Expand Down
6 changes: 5 additions & 1 deletion squape/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
# LICENSE file in the root directory of this source tree.
from contextlib import contextmanager

import squish
try:
import squish
except ImportError:
import squishtest as squish

from squape.internal.exceptions import SquishCapabilityError
from squape.report import debug

Expand Down
12 changes: 6 additions & 6 deletions squape/squishserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import os
from pathlib import Path

from remotesystem import RemoteSystem
try:
import squish
except ImportError:
import squishtest as squish

import squish
from squape.internal.exceptions import EnvironmentError
from squape.internal.exceptions import SquishserverError
from squape.report import debug
from squape.report import log
from squape.internal.exceptions import EnvironmentError, SquishserverError
from squape.report import debug, log


class SquishServer:
Expand Down
1 change: 0 additions & 1 deletion squape/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def video_capture(message: str = "", remove_on_success: bool = False) -> None:
except Exception:
raise
finally:

test.stopVideoCapture(message)

if remove_on_success:
Expand Down
6 changes: 5 additions & 1 deletion squape/vps.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import operator
import time

import squish
try:
import squish
except ImportError:
import squishtest as squish

import test


Expand Down

0 comments on commit 17e47d7

Please sign in to comment.