2020project_dir = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
2121
2222class TestBQMFunctionality (unittest .TestCase ):
23-
23+ @ unittest . skipIf ( os . getenv ( 'SKIP_INT_TESTS' ), "Skipping integration test." )
2424 def test_smoke_bqm_conversion (self ):
2525 """run bqm_conversion.py and check that nothing crashes"""
2626
2727 demo_file = os .path .join (project_dir , 'BQM_Functionality/bqm_conversion.py' )
2828 subprocess .check_output ([sys .executable , demo_file ])
2929
30+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
3031 def test_smoke_bqm_offsets (self ):
3132 """run bqm_offsets.py and check that nothing crashes"""
3233
3334 demo_file = os .path .join (project_dir , 'BQM_Functionality/bqm_offsets.py' )
3435 subprocess .check_output ([sys .executable , demo_file ])
3536
37+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
3638 def test_smoke_general_program_bqm (self ):
3739 """run general_program_bqm.py and check that nothing crashes"""
3840
3941 demo_file = os .path .join (project_dir , 'BQM_Functionality/general_program_bqm.py' )
4042 subprocess .check_output ([sys .executable , demo_file ])
4143
4244class TestBasicPrograms (unittest .TestCase ):
43-
45+ @ unittest . skipIf ( os . getenv ( 'SKIP_INT_TESTS' ), "Skipping integration test." )
4446 def test_smoke_general_program_ising (self ):
4547 """run general_program_ising.py and check that nothing crashes"""
4648
4749 demo_file = os .path .join (project_dir , 'Basic_Programs/general_program_ising.py' )
4850 subprocess .check_output ([sys .executable , demo_file ])
4951
52+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
5053 def test_smoke_general_program_qubo (self ):
5154 """run general_program_qubo.py and check that nothing crashes"""
5255
5356 demo_file = os .path .join (project_dir , 'Basic_Programs/general_program_qubo.py' )
5457 subprocess .check_output ([sys .executable , demo_file ])
5558
5659class TestExploringPegasus (unittest .TestCase ):
57-
60+ @ unittest . skipIf ( os . getenv ( 'SKIP_INT_TESTS' ), "Skipping integration test." )
5861 def test_smoke_biclique_embedding (self ):
5962 """run biclique_embedding.py and check that nothing crashes"""
6063
@@ -63,6 +66,7 @@ def test_smoke_biclique_embedding(self):
6366 # This test should be made more robust once we have usage information
6467 subprocess .check_output ([sys .executable , demo_file , "5" ])
6568
69+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
6670 def test_smoke_clique_embedding (self ):
6771 """run clique_embedding.py and check that nothing crashes"""
6872
@@ -71,61 +75,69 @@ def test_smoke_clique_embedding(self):
7175 # This test should be made more robust once we have usage information
7276 subprocess .check_output ([sys .executable , demo_file , "5" ])
7377
78+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
7479 def test_smoke_get_available_qubits (self ):
7580 """run get_available_qubits.py and check that nothing crashes"""
7681
7782 demo_file = os .path .join (project_dir , 'Exploring_Pegasus/get_available_qubits.py' )
7883 subprocess .check_output ([sys .executable , demo_file ])
7984
85+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
8086 def test_smoke_get_inactive_qubits (self ):
8187 """run get_inactive_qubits.py and check that nothing crashes"""
8288
8389 demo_file = os .path .join (project_dir , 'Exploring_Pegasus/get_inactive_qubits.py' )
8490 subprocess .check_output ([sys .executable , demo_file ])
8591
92+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
8693 def test_smoke_get_props (self ):
8794 """run get_props.py and check that nothing crashes"""
8895
8996 demo_file = os .path .join (project_dir , 'Exploring_Pegasus/get_props.py' )
9097 subprocess .check_output ([sys .executable , demo_file ])
9198
9299class TestPegasusEmbeddingVideo (unittest .TestCase ):
93-
100+ @ unittest . skipIf ( os . getenv ( 'SKIP_INT_TESTS' ), "Skipping integration test." )
94101 def test_smoke_double_plot (self ):
95102 """run double_plot.py and check that nothing crashes"""
96103
97104 demo_file = os .path .join (project_dir , 'Pegasus_Embedding_Video/double_plot.py' )
98105 subprocess .check_output ([sys .executable , demo_file ])
99106
107+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
100108 def test_smoke_draw_yield (self ):
101109 """run draw_yield.py and check that nothing crashes"""
102110
103111 demo_file = os .path .join (project_dir , 'Pegasus_Embedding_Video/draw_yield.py' )
104112 subprocess .check_output ([sys .executable , demo_file ])
105113
114+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
106115 def test_smoke_embed_draw_clique (self ):
107116 """run embed_draw_clique.py and check that nothing crashes"""
108117
109118 demo_file = os .path .join (project_dir , 'Pegasus_Embedding_Video/embed_draw_clique.py' )
110119 subprocess .check_output ([sys .executable , demo_file ])
111120
121+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
112122 def test_smoke_embed_draw_random (self ):
113123 """run embed_draw_random.py and check that nothing crashes"""
114124
115125 demo_file = os .path .join (project_dir , 'Pegasus_Embedding_Video/embed_draw_random.py' )
116126 subprocess .check_output ([sys .executable , demo_file ])
117127
128+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
118129 def test_smoke_embed_draw_sparse (self ):
119130 """run embed_draw_sparse.py and check that nothing crashes"""
120131
121132 demo_file = os .path .join (project_dir , 'Pegasus_Embedding_Video/embed_draw_sparse.py' )
122133 subprocess .check_output ([sys .executable , demo_file ])
123134
135+ @unittest .skipIf (os .getenv ('SKIP_INT_TESTS' ), "Skipping integration test." )
124136 def test_smoke_pegasus_graph (self ):
125137 """run test_smoke_pegasus_graph.py and check that nothing crashes"""
126138
127139 demo_file = os .path .join (project_dir , 'Pegasus_Embedding_Video/pegasus_graph.py' )
128140 subprocess .check_output ([sys .executable , demo_file ])
129141
130142if __name__ == '__main__' :
131- unittest .main ()
143+ unittest .main ()
0 commit comments