Browse Source

Merge pull request #16 from tomlowshang/fix-issue-14

Bastien Sevajol 7 years ago
parent
commit
5cd3ed8ed8
No account linked to committer's email
1 changed files with 4 additions and 5 deletions
  1. 4 5
      tests/test_terminals.py

+ 4 - 5
tests/test_terminals.py View File

165
 
165
 
166
         terminals_manager.stop()  # TODO pytest must execute this if have fail
166
         terminals_manager.stop()  # TODO pytest must execute this if have fail
167
 
167
 
168
-    @pytest.mark.skip(reason="Bug: globals fail in python 3.6 "
169
-                             "and still one process when not in debug ...")
170
     def test_terminal_as_main_process(self):
168
     def test_terminal_as_main_process(self):
171
         shared.reset()
169
         shared.reset()
172
         config = Config()
170
         config = Config()
179
             simulation=simulation,
177
             simulation=simulation,
180
         )
178
         )
181
 
179
 
182
-        terminal_pid = 0
183
-        core_pid = 0
184
         global terminal_pid
180
         global terminal_pid
185
         global core_pid
181
         global core_pid
182
+        terminal_pid = 0
183
+        core_pid = 0
186
 
184
 
187
         class MyMainTerminal(Terminal):
185
         class MyMainTerminal(Terminal):
188
             main_process = True
186
             main_process = True
211
             ),
209
             ),
212
         )
210
         )
213
         core.run()
211
         core.run()
214
-        core.cycle_manager.process_manager.terminate()
212
+        core.main_process_terminal.core_process.terminate()
213
+        cycle_manager.stop()
215
 
214
 
216
         assert terminal_pid == os.getpid()
215
         assert terminal_pid == os.getpid()
217
         assert core_pid == 0  # because changed in other process
216
         assert core_pid == 0  # because changed in other process