#171 get rid of tests warnings
Merged 3 years ago by kparal. Opened 3 years ago by kparal.

file modified
+1
@@ -29,6 +29,7 @@ 

      DEBUG = True

      SECRET_KEY = None  # REPLACE THIS WITH A RANDOM STRING

      SQLALCHEMY_DATABASE_URI = 'sqlite://'

+     SQLALCHEMY_TRACK_MODIFICATIONS = False

      BUGZILLA_URL = 'https://partner-bugzilla.redhat.com/'

      BUGZILLA_XMLRPC = BUGZILLA_URL + 'xmlrpc.cgi'

      KOJI_URL = 'http://koji.stg.fedoraproject.org/'

file modified
+2
@@ -3,3 +3,5 @@ 

  python_functions=test should

  python_files=test_* testfunc_*

  testpaths = testing

+ filterwarnings =

+     ignore:the imp module is deprecated in favour of importlib:DeprecationWarning:koji

@@ -39,6 +39,7 @@ 

  

      def teardown_method(self):

          db.session.rollback()

+         db.session.close()

          db.drop_all()

  

      def test_closing_commenting(self, monkeypatch):

@@ -34,6 +34,7 @@ 

  

      def teardown_method(self, method):

          db.session.rollback()

+         db.session.close()

          db.drop_all()

  

      def test_add_release(self):

@@ -72,6 +72,7 @@ 

      @classmethod

      def teardown_class(cls):

          db.session.rollback()

+         db.session.close()

          db.drop_all()

  

      def setup_method(self, method):

@@ -111,7 +111,6 @@ 

  

  class TestfuncUpdateSync(object):

      def setup_method(self, method):

-         db.session.flush()

          db.session.rollback()

          db.drop_all()

          db.create_all()
@@ -128,6 +127,11 @@ 

          db.session.commit()

          self.update_sync = UpdateSync(db, FakeBodhiInterface)

  

+     def teardown_method(self, method):

+         db.session.rollback()

+         db.session.close()

+         db.drop_all()

+ 

      def test_sync_single_bug_with_one_update(self):

          bug1 = add_bug(2000, 'testbug1', self.test_milestone99alpha)

          self.update_sync.sync_updates(self.test_release99)