Skip to content

Conversation

@StanFromIreland
Copy link
Contributor

No description provided.

@StanFromIreland
Copy link
Contributor Author

This is interesting, even on Ubuntu in the CI we create a codec object for unsupported codecs:

 ======================================================================
FAIL: test_available_encodings (test_iconvcodec.TestIconvcodecModule.test_available_encodings) (encoding='Georgian-PS')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/python-iconv/python-iconv/test_iconvcodec.py", line 95, in test_available_encodings
    raise AssertionError(
        f"Codec lookup succeeded but encode failed for '{encoding}'"
    ) from None
AssertionError: Codec lookup succeeded but encode failed for 'Georgian-PS'

======================================================================
FAIL: test_available_encodings (test_iconvcodec.TestIconvcodecModule.test_available_encodings) (encoding='ARMSCII-8')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/python-iconv/python-iconv/test_iconvcodec.py", line 95, in test_available_encodings
    raise AssertionError(
        f"Codec lookup succeeded but encode failed for '{encoding}'"
    ) from None
AssertionError: Codec lookup succeeded but encode failed for 'ARMSCII-8'

----------------------------------------------------------------------

@unittest.skipUnless(sys.platform.startswith("linux"), "Linux only test")
def test_encode(self):
bytestring = "Hallo".encode("T.61")
bytestring = "Hallo".encode("VISCII")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we switch, VISCII is not provided by CPython, and seems to be more cross-platform than T.61.

try:
"a".encode(encoding)
except Exception as e:
raise AssertionError(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use self.fail here as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants