Move GUI tests into a single function each, which solves ordering bugs, and also means we don't need to depend on pytest-ordering

This commit is contained in:
Miguel Jacq 2018-10-15 11:15:32 +11:00
parent 46bec2f261
commit ed224f0388
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6
18 changed files with 17 additions and 95 deletions

View File

@ -5,7 +5,6 @@ pluggy==0.6.0
py==1.6.0
pytest==3.4.2
pytest-faulthandler==1.5.0
pytest-ordering==0.5
pytest-qt==3.1.0
six==1.11.0
urllib3==1.23

View File

@ -13,11 +13,8 @@ class LocalReceiveModePublicModeTest(unittest.TestCase, GuiReceiveTest):
}
cls.gui = GuiReceiveTest.set_up(test_settings, 'LocalReceiveModePublicModeTest')
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
def test_run_all_receive_mode_tests(self):
self.run_all_receive_mode_tests(True, True)
if __name__ == "__main__":

View File

@ -12,11 +12,8 @@ class LocalReceiveModeTest(unittest.TestCase, GuiReceiveTest):
}
cls.gui = GuiReceiveTest.set_up(test_settings, 'LocalReceiveModeTest')
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
def test_run_all_receive_mode_tests(self):
self.run_all_receive_mode_tests(False, True)
if __name__ == "__main__":

View File

@ -12,11 +12,8 @@ class LocalShareModePublicModeTest(unittest.TestCase, GuiShareTest):
}
cls.gui = GuiShareTest.set_up(test_settings, 'LocalShareModePublicModeTest')
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
def test_run_all_share_mode_tests(self):
self.run_all_share_mode_tests(True, False)
if __name__ == "__main__":

View File

@ -12,11 +12,8 @@ class LocalShareModeStayOpenTest(unittest.TestCase, GuiShareTest):
}
cls.gui = GuiShareTest.set_up(test_settings, 'LocalShareModeStayOpenTest')
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
def test_run_all_share_mode_tests(self):
self.run_all_share_mode_tests(False, True)
if __name__ == "__main__":

View File

@ -11,11 +11,8 @@ class LocalShareModeTest(unittest.TestCase, GuiShareTest):
}
cls.gui = GuiShareTest.set_up(test_settings, 'LocalShareModeTest')
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
def test_run_all_share_mode_tests(self):
self.run_all_share_mode_tests(False, False)
if __name__ == "__main__":

View File

@ -15,11 +15,8 @@ class LocalShareModePersistentSlugTest(unittest.TestCase, GuiShareTest):
}
cls.gui = GuiShareTest.set_up(test_settings, 'LocalShareModePersistentSlugTest')
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
def test_run_all_share_mode_tests(self):
self.run_all_share_mode_persistent_tests(False, True)
if __name__ == "__main__":

View File

@ -13,11 +13,8 @@ class LocalShareModeTimerTest(unittest.TestCase, GuiShareTest):
}
cls.gui = GuiShareTest.set_up(test_settings, 'LocalShareModeTimerTest')
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
def test_run_all_share_mode_timer_tests(self):
self.run_all_share_mode_timer_tests(False)
if __name__ == "__main__":

View File

@ -14,27 +14,11 @@ class ShareModeCancelSecondShareTest(unittest.TestCase, TorGuiShareTest):
cls.gui = TorGuiShareTest.set_up(test_settings, 'ShareModeCancelSecondShareTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_share_mode_tests(self):
self.run_all_share_mode_tests(False, False)
@pytest.mark.run(after='test_run_share_mode_tests')
@pytest.mark.tor
def test_cancel_the_share(self):
self.cancel_the_share(self.gui.share_mode)
@pytest.mark.run(after='test_cancel_the_share')
@pytest.mark.tor
def test_server_is_stopped_round2(self):
self.server_is_stopped(self.gui.share_mode, False)
@pytest.mark.run(after='test_server_is_stopped_round2')
@pytest.mark.tor
def test_web_service_is_stopped_round2(self):
self.web_service_is_stopped()
if __name__ == "__main__":

View File

@ -14,12 +14,8 @@ class ReceiveModeTest(unittest.TestCase, TorGuiReceiveTest):
cls.gui = TorGuiReceiveTest.set_up(test_settings, 'ReceiveModeTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_all_receive_mode_tests(self):
self.run_all_receive_mode_tests(True, True)
if __name__ == "__main__":

View File

@ -13,12 +13,8 @@ class ReceiveModeTest(unittest.TestCase, TorGuiReceiveTest):
cls.gui = TorGuiReceiveTest.set_up(test_settings, 'ReceiveModeTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_all_receive_mode_tests(self):
self.run_all_receive_mode_tests(False, True)
if __name__ == "__main__":

View File

@ -12,17 +12,9 @@ class ShareModeCancelTest(unittest.TestCase, TorGuiShareTest):
cls.gui = TorGuiShareTest.set_up(test_settings, 'ShareModeCancelTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_share_mode_setup_tests(self):
self.run_all_share_mode_setup_tests()
@pytest.mark.run(after='test_run_share_mode_setup_tests')
@pytest.mark.tor
def test_cancel_the_share(self):
self.cancel_the_share(self.gui.share_mode)
if __name__ == "__main__":

View File

@ -13,12 +13,8 @@ class ShareModePublicModeTest(unittest.TestCase, TorGuiShareTest):
cls.gui = TorGuiShareTest.set_up(test_settings, 'ShareModePublicModeTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_all_share_mode_tests(self):
self.run_all_share_mode_tests(True, False)
if __name__ == "__main__":

View File

@ -13,12 +13,8 @@ class ShareModeStayOpenTest(unittest.TestCase, TorGuiShareTest):
cls.gui = TorGuiShareTest.set_up(test_settings, 'ShareModeStayOpenTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_all_share_mode_tests(self):
self.run_all_share_mode_tests(False, True)
if __name__ == "__main__":

View File

@ -12,12 +12,8 @@ class ShareModeTest(unittest.TestCase, TorGuiShareTest):
cls.gui = TorGuiShareTest.set_up(test_settings, 'ShareModeTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_all_share_mode_tests(self):
self.run_all_share_mode_tests(False, False)
if __name__ == "__main__":

View File

@ -17,12 +17,8 @@ class ShareModePersistentSlugTest(unittest.TestCase, TorGuiShareTest):
cls.gui = TorGuiShareTest.set_up(test_settings, 'ShareModePersistentSlugTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_all_share_mode_tests(self):
self.run_all_share_mode_persistent_tests(False, True)
if __name__ == "__main__":

View File

@ -14,12 +14,8 @@ class ShareModeStealthTest(unittest.TestCase, TorGuiShareTest):
cls.gui = TorGuiShareTest.set_up(test_settings, 'ShareModeStealthTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_stealth_mode_tests(self):
self.run_all_share_mode_setup_tests()
self.run_all_share_mode_started_tests(False)
self.copy_have_hidserv_auth_button(self.gui.share_mode)

View File

@ -14,12 +14,8 @@ class ShareModeTimerTest(unittest.TestCase, TorGuiShareTest):
cls.gui = TorGuiShareTest.set_up(test_settings, 'ShareModeTimerTest')
@pytest.mark.tor
def test_run_all_common_setup_tests(self):
def test_gui(self):
self.run_all_common_setup_tests()
@pytest.mark.run(after='test_run_all_common_setup_tests')
@pytest.mark.tor
def test_run_all_share_mode_timer_tests(self):
self.run_all_share_mode_timer_tests(False)
if __name__ == "__main__":