Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo: tests/test_xkcdpass.py, line 61 #161

Closed
ahesford opened this issue Feb 24, 2024 · 2 comments
Closed

Typo: tests/test_xkcdpass.py, line 61 #161

ahesford opened this issue Feb 24, 2024 · 2 comments

Comments

@ahesford
Copy link

The self.assertEquals call in test_random_delimiter should be self.assertEqual (no trailing s).

@benkohler
Copy link
Contributor

This seems to be making tests fail on python-3.12:

`============================= test session starts ==============================
platform linux -- Python 3.12.2, pytest-8.1.1, pluggy-1.4.0 -- /var/tmp/portage/app-admin/xkcdpass-1.19.8/work/xkcdpass-1.19.8-python3_12/install/usr/bin/python3.12
cachedir: .pytest_cache
rootdir: /var/tmp/portage/app-admin/xkcdpass-1.19.8/work/xkcdpass-1.19.8
collecting ... collected 9 items

tests/test_xkcdpass.py::XkcdPasswordTests::test_acrostic PASSED [1/9]
tests/test_xkcdpass.py::XkcdPasswordTests::test_delim PASSED [2/9]
tests/test_xkcdpass.py::XkcdPasswordTests::test_loadwordfile PASSED [3/9]
tests/test_xkcdpass.py::XkcdPasswordTests::test_random_delimiter FAILED [4/9]
tests/test_xkcdpass.py::XkcdPasswordTests::test_regex PASSED [5/9]
tests/test_xkcdpass.py::XkcdPasswordTests::test_set_case PASSED [6/9]
tests/test_xkcdpass.py::TestEmitPasswords::test_emits_no_separator_when_specified_separator_empty PASSED [7/9]
tests/test_xkcdpass.py::TestEmitPasswords::test_emits_specified_count_of_passwords PASSED [8/9]
tests/test_xkcdpass.py::TestEmitPasswords::test_emits_specified_separator_between_passwords PASSED [9/9]

=================================== FAILURES ===================================
___________________ XkcdPasswordTests.test_random_delimiter ____________________

self = <tests.test_xkcdpass.XkcdPasswordTests testMethod=test_random_delimiter>

def test_random_delimiter(self):
    wordlength = 4
    numwords = 3
    wordlist = xkcd_password.generate_wordlist(
        WORDFILE, min_length=wordlength, max_length=wordlength
    )
    result = xkcd_password.generate_xkcdpassword(
        wordlist, numwords=numwords, random_delimiters=True
    )
    # check that the result is the right length
  self.assertEquals(len(result), numwords * wordlength + (numwords - 1))

E AttributeError: 'XkcdPasswordTests' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

numwords = 3
result = 'cork#dint2rage'
self = <tests.test_xkcdpass.XkcdPasswordTests testMethod=test_random_delimiter>
wordlength = 4
wordlist = ['howl',`

@redacted
Copy link
Owner

redacted commented Apr 1, 2024

This is fixed in the latest version 1.19.9, thank you both for flagging!

@redacted redacted closed this as completed Apr 1, 2024
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

No branches or pull requests

3 participants