Skip to content

Commit

Permalink
Fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
const-cloudinary committed May 20, 2023
1 parent 7d01180 commit c7edd2d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/test_modules/test_cli_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ def tearDown(self) -> None:
time.sleep(1)
shutil.rmtree(self.LOCAL_SYNC_PULL_DIR, ignore_errors=True)

@retry_assertion
def test_cli_sync_push(self):
result = self.runner.invoke(cli, ['sync', '--push', '-F', TEST_FILES_DIR, self.CLD_SYNC_DIR])

self.assertEqual(0, result.exit_code)
self.assertIn("Synced | 12", result.output)
self.assertIn("Done!", result.output)

@retry_assertion
def test_cli_sync_push_twice(self):
self._upload_sync_files(TEST_FILES_DIR)

Expand All @@ -46,6 +48,7 @@ def test_cli_sync_push_twice(self):
self.assertIn("Skipping 12 items", result.output)
self.assertIn("Done!", result.output)

@retry_assertion
def test_cli_sync_push_out_of_sync(self):
self._upload_sync_files(TEST_FILES_DIR)

Expand All @@ -62,6 +65,7 @@ def test_cli_sync_push_out_of_sync(self):
self.assertIn("Synced | 1", result.output)
self.assertIn("Done!", result.output)

@retry_assertion
def test_cli_sync_pull(self):
self._upload_sync_files(TEST_FILES_DIR)

Expand Down Expand Up @@ -92,6 +96,7 @@ def test_cli_sync_pull_twice(self):
self.assertIn("Skipping 12 items", result.output)
self.assertIn("Done!", result.output)

@retry_assertion
def test_cli_sync_pull_out_of_sync(self):
self._upload_sync_files(TEST_FILES_DIR)

Expand Down

0 comments on commit c7edd2d

Please sign in to comment.