commit/galaxy-central: greg: Order imports per database_contexts requirements to fix the tool shed's install and test framework.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/5f221e577480/ Changeset: 5f221e577480 User: greg Date: 2014-01-03 16:02:19 Summary: Order imports per database_contexts requirements to fix the tool shed's install and test framework. Affected #: 2 files diff -r f0f7c3cd2e8af64243f878c04f418c1ee054bc55 -r 5f221e5774804c77987831bebc6941d5a91fa872 scripts/functional_tests.py --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -485,9 +485,14 @@ master_api_key=master_api_key, user_api_key=os.environ.get( "GALAXY_TEST_USER_API_KEY", default_galaxy_user_key ), ) - else: #when testing data managers, do not test toolbox + else: + # We must make sure that functional.test_toolbox is always imported after + # database_contexts.galaxy_content is set (which occurs in this method above). + # If functional.test_toolbox is imported before database_contexts.galaxy_content + # is set, sa_session will be None in all methods that use it. import functional.test_toolbox functional.test_toolbox.toolbox = app.toolbox + # When testing data managers, do not test toolbox. functional.test_toolbox.build_tests( testing_shed_tools=testing_shed_tools, master_api_key=master_api_key, diff -r f0f7c3cd2e8af64243f878c04f418c1ee054bc55 -r 5f221e5774804c77987831bebc6941d5a91fa872 test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py --- a/test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py +++ b/test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py @@ -52,7 +52,6 @@ from paste import httpserver from functional import database_contexts -import functional.test_toolbox as imported_test_toolbox log = logging.getLogger( 'install_and_test_repositories_with_tools' ) @@ -136,6 +135,10 @@ return tool_id, tool_version def install_and_test_repositories( app, galaxy_shed_tools_dict, galaxy_shed_tool_conf_file ): + # We must make sure that functional.test_toolbox is always imported after database_contexts.galaxy_content + # is set (which occurs in the main method before this method is called). If functional.test_toolbox is + # imported before database_contexts.galaxy_content is set, sa_session will be None in all methods that use it. + import functional.test_toolbox as imported_test_toolbox global test_toolbox test_toolbox = imported_test_toolbox # Initialize a dictionary for the summary that will be printed to stdout. @@ -442,7 +445,6 @@ app = UniverseApplication( **kwargs ) database_contexts.galaxy_context = app.model.context database_contexts.install_context = app.install_model.context - log.debug( "Embedded Galaxy application started..." ) # ---- Run galaxy webserver ------------------------------------------------------ server = None Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org