diff --git a/.circleci/config.yml b/.circleci/config.yml index 75601453a4199fc55445224d69a79969fe260cb5_LmNpcmNsZWNpL2NvbmZpZy55bWw=..e75ec7e2484fc0f98732bbe9f32cd12d72610617_LmNpcmNsZWNpL2NvbmZpZy55bWw= 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ name: Style check # Main test run, w/ coverage, and latest-supported cryptography - orb/coverage: - name: Test 3.6 (w/ coverage, latest crypto) + name: Test # Non-coverage runs w/ other crypto versions. # (Phrased as 2-dimensional matrix but 3.6 only for now to save credits) - orb/test: @@ -75,8 +75,8 @@ - sdist-test-suite: name: Test within sdist requires: - - "Test 3.6 (w/ coverage, latest crypto)" + - "Test" - "Release test" # Test other interpreters if main passed - orb/test: name: Test << matrix.version >> @@ -79,8 +79,8 @@ - "Release test" # Test other interpreters if main passed - orb/test: name: Test << matrix.version >> - requires: ["Test 3.6 (w/ coverage, latest crypto)"] + requires: ["Test"] matrix: parameters: version: ["3.7", "3.8", "3.9"] @@ -88,4 +88,4 @@ # all those credits if the main tests would also fail...) - orb/docs: name: "Docs" - requires: ["Test 3.6 (w/ coverage, latest crypto)"] + requires: ["Test"] diff --git a/tests/__init__.py b/tests/__init__.py index 75601453a4199fc55445224d69a79969fe260cb5_dGVzdHMvX19pbml0X18ucHk=..e75ec7e2484fc0f98732bbe9f32cd12d72610617_dGVzdHMvX19pbml0X18ucHk= 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -36,7 +36,7 @@ def _decorate_with_locale(category, try_locales, test_method): """Decorate test_method to run after switching to a different locale.""" - def _test_under_locale(testself, sftp): + def _test_under_locale(testself, *args, **kwargs): original = locale.setlocale(category) while try_locales: try: @@ -46,6 +46,6 @@ try_locales.pop(0) else: try: - return test_method(testself) + return test_method(testself, *args, **kwargs) finally: locale.setlocale(category, original) @@ -50,8 +50,7 @@ finally: locale.setlocale(category, original) - skipTest = getattr(testself, "skipTest", None) - if skipTest is not None: - skipTest("No usable locales installed") + # No locales could be used? Just skip the decorated test :( + skip("No usable locales installed") functools.update_wrapper(_test_under_locale, test_method) return _test_under_locale diff --git a/tests/test_sftp.py b/tests/test_sftp.py index 75601453a4199fc55445224d69a79969fe260cb5_dGVzdHMvdGVzdF9zZnRwLnB5..e75ec7e2484fc0f98732bbe9f32cd12d72610617_dGVzdHMvdGVzdF9zZnRwLnB5 100644 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -277,7 +277,7 @@ sftp.open(sftp.FOLDER + "/canard.txt", "w").close() try: folder_contents = sftp.listdir(sftp.FOLDER) - self.assertEqual(["canard.txt"], folder_contents) + assert ["canard.txt"] == folder_contents finally: sftp.remove(sftp.FOLDER + "/canard.txt") @@ -797,7 +797,7 @@ """Test SFTPAttributes under a locale with non-ascii time strings.""" some_stat = os.stat(sftp.FOLDER) sftp_attributes = SFTPAttributes.from_stat(some_stat, u("a_directory")) - self.assertTrue(b"a_directory" in sftp_attributes.asbytes()) + assert b"a_directory" in sftp_attributes.asbytes() def test_sftp_attributes_empty_str(self, sftp): sftp_attributes = SFTPAttributes()