python / python/cpython

Add more tests for `getpass`

Open
#130,524 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

tests
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

This is something I thought of when working #130496, I noticed that some tests were missing.
Test Lib/test/test_getpass.py only has three classes: GetpassGetuserTest, GetpassRawinputTest, UnixGetpassTest.

This clearly doesn't cover all cases, I think we should add at least WinGetpassTest and check that both implementations (unix_getpass and win_getpass) work the same.

Linked PRs
  • gh-130529

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Lib/test/test_getpass.py and its GetpassGetuserTest, GetpassRawinputTest, and UnixGetpassTest classes. Read the unix_getpass and win_getpass implementations, then run the existing getpass tests to identify missing cases. Done means adding WinGetpassTest coverage and checking that both implementations behave consistently; gh-130529 is also linked in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.