Skip to content

Commit

Permalink
Skip SSHCheckerTests on Windows
Browse files Browse the repository at this point in the history
The Windows builds are failing with this message:

    [ERROR]
    Traceback (most recent call last):
      File "D:\a\1\s\.tox\alldeps-withcov-windows\lib\site-packages\twisted\cred\test\test_strcred.py", line 434, in test_isChecker
        sshChecker = strcred.makeChecker("sshkey")
      File "D:\a\1\s\.tox\alldeps-withcov-windows\lib\site-packages\twisted\cred\strcred.py", line 117, in makeChecker
        return findCheckerFactory(authType).generateChecker(argstring)
      File "D:\a\1\s\.tox\alldeps-withcov-windows\lib\site-packages\twisted\plugins\cred_sshkeys.py", line 42, in generateChecker
        return SSHPublicKeyChecker(UNIXAuthorizedKeysFiles())
      File "D:\a\1\s\.tox\alldeps-withcov-windows\lib\site-packages\twisted\conch\checkers.py", line 527, in __init__
        raise ValueError("No pwd module found, and no userdb argument passed.")
    builtins.ValueError: No pwd module found, and no userdb argument passed.

    twisted.cred.test.test_strcred.SSHCheckerTests.test_isChecker

This exception was introduced in this PR. Previous to this PR the
UNIXAuthorizedKeysFiles initializer would allow self.userdb to be None
and generate an AttributeError later when attempting to get authorized
keys.
  • Loading branch information
twm committed May 22, 2022
1 parent 00a930b commit 3cfb5c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/twisted/cred/test/test_strcred.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ def test_warnWithBadFilename(self):
self.assertIn(cred_file.invalidFileWarning, newOutput.getvalue())


@skipIf(not pwd, "Required module not available: pwd")
@skipIf(not requireModule("cryptography"), "cryptography is not available")
@skipIf(not requireModule("pyasn1"), "pyasn1 is not available")
class SSHCheckerTests(TestCase):
Expand Down

0 comments on commit 3cfb5c1

Please sign in to comment.