old_contents: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  import os
  import pytest
  from sqlalchemy import create_engine
  from sqlalchemy.exc import IntegrityError
  
  TEST_DATABASE_URL = os.environ.get(
      'DATABASE_URL',
      'postgresql://jonathan:@localhost:5432/test-learning-journal'
  )
  os.environ['DATABASE_URL'] = TEST_DATABASE_URL
  os.environ['TESTING'] = "True"
  
  import journal
  
new_contents: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  import os
  import pytest
  from sqlalchemy import create_engine
  from sqlalchemy.exc import IntegrityError
  
  TEST_DATABASE_URL = os.environ.get(
      'DATABASE_URL',
      'postgresql://jonathan:@localhost:5432/test-learning-journal'
  )
  os.environ['DATABASE_URL'] = TEST_DATABASE_URL
  os.environ['TESTING'] = "True"
  
  import journal
  
  
  @pytest.fixture(scope='session')
  def connection(request):
      engine = create_engine(TEST_DATABASE_URL)
      journal.Base.metadata.create_all(engine)
      connection = engine.connect()
      journal.DBSession.registry.clear()
      journal.DBSession.configure(bind=connection)
      journal.Base.metadata.bind = engine
      request.addfinalizer(journal.Base.metadata.drop_all)
      return connection
  
subject: Add connection pytest fixture