import operator
import numpy as np
from glue.qt import get_qapp
from glue.core.data import Data
from glue.core.data_collection import DataCollection
from glue.app.qt.application import GlueApplication
from glue.core.subset import InequalitySubsetState
# from glue.core.tests.util import simple_session
from ..vol_glue_viewer import GlueVispyViewer


def test_viewer():

    app = get_qapp()

    data = Data(x=np.arange(1000).reshape((10, 10, 10)) / 1000.)
    dc = DataCollection([data])
    app = GlueApplication(dc)
    app.new_data_viewer(GlueVispyViewer, data=data)
    subset_state1 = InequalitySubsetState(data.find_component_id('x'), 2/3., operator.gt)
    dc.new_subset_group(label='test_subset1', subset_state=subset_state1)
    subset_state2 = InequalitySubsetState(data.find_component_id('x'), 1/3., operator.lt)
    dc.new_subset_group(label='test_subset2', subset_state=subset_state2)
    app.show()

@@ -138,24 +138,34 @@
 aCollection%0A
+%0Atry:%0A    
 from glue.ap
@@ -200,24 +200,90 @@
 Application%0A
+except:%0A    from glue.qt.glue_application import GlueApplication%0A%0A
 from glue.co

Fix compatibility with latest stable glue version