-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17234 from mvdbeek/single_api_instance
Reuse test instance during non-integration tests
- Loading branch information
Showing
9 changed files
with
88 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
from galaxy_test.driver.driver_util import GalaxyTestDriver | ||
from galaxy_test.selenium.framework import SeleniumTestCase | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def real_driver(): | ||
if not os.environ.get("GALAXY_TEST_ENVIRONMENT_CONFIGURED"): | ||
driver = GalaxyTestDriver() | ||
driver.setup(SeleniumTestCase) | ||
try: | ||
yield driver | ||
finally: | ||
driver.tear_down() | ||
else: | ||
yield None | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def embedded_driver(real_driver, request): | ||
request.cls._test_driver = real_driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
def pytest_unconfigure(config): | ||
try: | ||
# This needs to be run if no test were run. | ||
from .test_toolbox_pytest import DRIVER | ||
|
||
DRIVER.tear_down() | ||
print("Galaxy test driver shutdown successful") | ||
except Exception: | ||
pass | ||
import os | ||
|
||
import pytest | ||
|
||
from galaxy_test.driver.driver_util import GalaxyTestDriver | ||
from .test_toolbox_pytest import TestFrameworkTools | ||
|
||
|
||
@pytest.fixture(scope="session", autouse=True) | ||
def celery_includes(): | ||
yield ["galaxy.celery.tasks"] | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def real_driver(): | ||
if not os.environ.get("GALAXY_TEST_ENVIRONMENT_CONFIGURED"): | ||
driver = GalaxyTestDriver() | ||
driver.setup(TestFrameworkTools) | ||
try: | ||
yield driver | ||
finally: | ||
driver.tear_down() | ||
else: | ||
yield None | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def embedded_driver(real_driver, request): | ||
request.cls._test_driver = real_driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters