def tearDown(self): """ Test Teardown """ self.process.terminate() session.close() engine.dispose() Base.metadata.drop_all(engine) self.browser.quit()
def tearDown(self): """ Test teardown """ self.process.terminate() session.close() engine.dispose() Base.metadata.drop_all(engine) self.browser.quit()
def tearDown(self): """ Test teardown """ # Remove the tables and their data from the database self.process.terminate() session.close() engine.dispose() Base.metadata.drop_all(engine)
def tearDown(self): """ Test teardown """ # Remove the tables and their data from the database self.process.terminate() session.close() engine.dispose() Base.metadata.drop_all(engine) self.browser.quit()
def tearDown(self): """Test Teardown""" #Remove the tables and their data self.process.terminate() session.close() engine.dispose() Base.metadata.drop_all(engine) self.browser.quit()
def tearDown(self): ''' Test teardown ''' # remove the tables and their data from the database self.process.terminate() session.close() engine.dispose() Base.metadata.drop_all(engine) self.browser.quit() if os.environ['CONFIG_PATH'] != 'blog.config.TravisConfig': os.system('pgrep phantomjs | xargs kill')
def tearDown(self): """ Test teardown """ # Remove the tables and their data from the db # kill server using process.terminate method self.process.terminate() session.close() engine.dispose() Base.metadata.drop_all(engine) # exit browser using browser.quit method self.browser.quit()
import multiprocessing import time from urllib.parse import urlparse from werkzeug.security import generate_password_hash from splinter import Browser # configure your app to use the testing configuration if not 'CONFIG_PATH' in os.environ: os.environ['CONFIG_PATH'] = 'blog.config.TestingConfig' from blog import app from blog.database import Base, engine, session, User '''adding engine disposition and drop_all before setup in case earlier test suite run was interrupted''' engine.dispose() Base.metadata.drop_all(engine) class TestViews(unittest.TestCase): def setUp(self): ''' Test setup ''' self.browser = Browser('phantomjs') # if we don't set the window size, we won't be able to interact with UI that might # be hidden because of our media queries with a smaller emulated window self.browser.driver.set_window_size(1120, 550) # set up the tables in the database Base.metadata.create_all(engine)
import unittest import multiprocessing import time from urllib.parse import urlparse from werkzeug.security import generate_password_hash from splinter import Browser # configure your app to use the testing configuration if not 'CONFIG_PATH' in os.environ: os.environ['CONFIG_PATH'] = 'blog.config.TestingConfig' from blog import app from blog.database import Base, engine, session, User '''adding engine disposition and drop_all before setup in case earlier test suite run was interrupted''' engine.dispose() Base.metadata.drop_all(engine) class TestViews(unittest.TestCase): def setUp(self): ''' Test setup ''' self.browser = Browser('phantomjs') # if we don't set the window size, we won't be able to interact with UI that might # be hidden because of our media queries with a smaller emulated window self.browser.driver.set_window_size(1120, 550) # set up the tables in the database Base.metadata.create_all(engine)