From ed224f03884e80922127497d68576b860feaa3af Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 15 Oct 2018 11:15:32 +1100 Subject: [PATCH] Move GUI tests into a single function each, which solves ordering bugs, and also means we don't need to depend on pytest-ordering --- install/requirements-tests.txt | 1 - ...are_receive_mode_upload_public_mode_test.py | 5 +---- ...ocal_onionshare_receive_mode_upload_test.py | 5 +---- ...are_share_mode_download_public_mode_test.py | 5 +---- ...share_share_mode_download_stay_open_test.py | 5 +---- ...ocal_onionshare_share_mode_download_test.py | 5 +---- ...ionshare_share_mode_slug_persistent_test.py | 5 +---- .../local_onionshare_share_mode_timer_test.py | 5 +---- ...ionshare_790_cancel_on_second_share_test.py | 18 +----------------- ...are_receive_mode_upload_public_mode_test.py | 6 +----- tests/onionshare_receive_mode_upload_test.py | 6 +----- .../onionshare_share_mode_cancel_share_test.py | 10 +--------- ...are_share_mode_download_public_mode_test.py | 6 +----- ...share_share_mode_download_stay_open_test.py | 6 +----- tests/onionshare_share_mode_download_test.py | 6 +----- tests/onionshare_share_mode_persistent_test.py | 6 +----- tests/onionshare_share_mode_stealth_test.py | 6 +----- tests/onionshare_share_mode_timer_test.py | 6 +----- 18 files changed, 17 insertions(+), 95 deletions(-) diff --git a/install/requirements-tests.txt b/install/requirements-tests.txt index 0d9c1581..b931afd1 100644 --- a/install/requirements-tests.txt +++ b/install/requirements-tests.txt @@ -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 diff --git a/tests/local_onionshare_receive_mode_upload_public_mode_test.py b/tests/local_onionshare_receive_mode_upload_public_mode_test.py index 27bf9b2c..c99fae52 100644 --- a/tests/local_onionshare_receive_mode_upload_public_mode_test.py +++ b/tests/local_onionshare_receive_mode_upload_public_mode_test.py @@ -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__": diff --git a/tests/local_onionshare_receive_mode_upload_test.py b/tests/local_onionshare_receive_mode_upload_test.py index f6594105..dc6c1f06 100644 --- a/tests/local_onionshare_receive_mode_upload_test.py +++ b/tests/local_onionshare_receive_mode_upload_test.py @@ -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__": diff --git a/tests/local_onionshare_share_mode_download_public_mode_test.py b/tests/local_onionshare_share_mode_download_public_mode_test.py index 2a3f9584..bfed9443 100644 --- a/tests/local_onionshare_share_mode_download_public_mode_test.py +++ b/tests/local_onionshare_share_mode_download_public_mode_test.py @@ -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__": diff --git a/tests/local_onionshare_share_mode_download_stay_open_test.py b/tests/local_onionshare_share_mode_download_stay_open_test.py index 1f734ae7..b68516a2 100644 --- a/tests/local_onionshare_share_mode_download_stay_open_test.py +++ b/tests/local_onionshare_share_mode_download_stay_open_test.py @@ -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__": diff --git a/tests/local_onionshare_share_mode_download_test.py b/tests/local_onionshare_share_mode_download_test.py index 274cc311..a2a16c96 100644 --- a/tests/local_onionshare_share_mode_download_test.py +++ b/tests/local_onionshare_share_mode_download_test.py @@ -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__": diff --git a/tests/local_onionshare_share_mode_slug_persistent_test.py b/tests/local_onionshare_share_mode_slug_persistent_test.py index 3450ec3f..03285fa1 100644 --- a/tests/local_onionshare_share_mode_slug_persistent_test.py +++ b/tests/local_onionshare_share_mode_slug_persistent_test.py @@ -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__": diff --git a/tests/local_onionshare_share_mode_timer_test.py b/tests/local_onionshare_share_mode_timer_test.py index f9f36c48..3d20efc4 100644 --- a/tests/local_onionshare_share_mode_timer_test.py +++ b/tests/local_onionshare_share_mode_timer_test.py @@ -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__": diff --git a/tests/onionshare_790_cancel_on_second_share_test.py b/tests/onionshare_790_cancel_on_second_share_test.py index 36725fb0..21747d4c 100644 --- a/tests/onionshare_790_cancel_on_second_share_test.py +++ b/tests/onionshare_790_cancel_on_second_share_test.py @@ -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__": diff --git a/tests/onionshare_receive_mode_upload_public_mode_test.py b/tests/onionshare_receive_mode_upload_public_mode_test.py index ee0c5c34..56b49c81 100644 --- a/tests/onionshare_receive_mode_upload_public_mode_test.py +++ b/tests/onionshare_receive_mode_upload_public_mode_test.py @@ -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__": diff --git a/tests/onionshare_receive_mode_upload_test.py b/tests/onionshare_receive_mode_upload_test.py index f1f683cc..0fd8d5ed 100644 --- a/tests/onionshare_receive_mode_upload_test.py +++ b/tests/onionshare_receive_mode_upload_test.py @@ -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__": diff --git a/tests/onionshare_share_mode_cancel_share_test.py b/tests/onionshare_share_mode_cancel_share_test.py index 97adf9ce..9770cc35 100644 --- a/tests/onionshare_share_mode_cancel_share_test.py +++ b/tests/onionshare_share_mode_cancel_share_test.py @@ -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__": diff --git a/tests/onionshare_share_mode_download_public_mode_test.py b/tests/onionshare_share_mode_download_public_mode_test.py index a4a3bfb1..8409720a 100644 --- a/tests/onionshare_share_mode_download_public_mode_test.py +++ b/tests/onionshare_share_mode_download_public_mode_test.py @@ -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__": diff --git a/tests/onionshare_share_mode_download_stay_open_test.py b/tests/onionshare_share_mode_download_stay_open_test.py index 33544217..c16f91e9 100644 --- a/tests/onionshare_share_mode_download_stay_open_test.py +++ b/tests/onionshare_share_mode_download_stay_open_test.py @@ -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__": diff --git a/tests/onionshare_share_mode_download_test.py b/tests/onionshare_share_mode_download_test.py index 8d6d9655..194328d9 100644 --- a/tests/onionshare_share_mode_download_test.py +++ b/tests/onionshare_share_mode_download_test.py @@ -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__": diff --git a/tests/onionshare_share_mode_persistent_test.py b/tests/onionshare_share_mode_persistent_test.py index 9a813e5d..3c283943 100644 --- a/tests/onionshare_share_mode_persistent_test.py +++ b/tests/onionshare_share_mode_persistent_test.py @@ -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__": diff --git a/tests/onionshare_share_mode_stealth_test.py b/tests/onionshare_share_mode_stealth_test.py index d7e13540..b414de1f 100644 --- a/tests/onionshare_share_mode_stealth_test.py +++ b/tests/onionshare_share_mode_stealth_test.py @@ -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) diff --git a/tests/onionshare_share_mode_timer_test.py b/tests/onionshare_share_mode_timer_test.py index 32e28c00..b53905d0 100644 --- a/tests/onionshare_share_mode_timer_test.py +++ b/tests/onionshare_share_mode_timer_test.py @@ -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__":