Test that get_user() function works even if environment variables required by getpass module are missing from the environment on Windows (#1010).
(monkeypatch)
| 424 | |
| 425 | @pytest.mark.skipif(not sys.platform.startswith("win"), reason="win only") |
| 426 | def test_get_user(monkeypatch): |
| 427 | """Test that get_user() function works even if environment variables |
| 428 | required by getpass module are missing from the environment on Windows |
| 429 | (#1010). |
| 430 | """ |
| 431 | monkeypatch.delenv("USER", raising=False) |
| 432 | monkeypatch.delenv("USERNAME", raising=False) |
| 433 | assert get_user() is None |
| 434 | |
| 435 | |
| 436 | class TestNumberedDir: |