'Test session context without cluster context.
@since 3.4
@jira_ticket PYTHON-521
@expected_result session should be created correctly. Session should shutdown correctly outside of context
@test_category configuration'

def test_session_no_cluster(self):

    cluster = Cluster(**self.cluster_kwargs)
    unmanaged_session = cluster.connect()
    with cluster.connect() as session:
        self.assertFalse(cluster.is_shutdown)
        self.assertFalse(session.is_shutdown)
        self.assertFalse(unmanaged_session.is_shutdown)
        self.assertTrue(session.execute('select    release_version    from    system.local')[0])
    self.assertTrue(session.is_shutdown)
    self.assertFalse(cluster.is_shutdown)
    self.assertFalse(unmanaged_session.is_shutdown)
    unmanaged_session.shutdown()
    self.assertTrue(unmanaged_session.is_shutdown)
    self.assertFalse(cluster.is_shutdown)
    cluster.shutdown()
    self.assertTrue(cluster.is_shutdown)
