--- a/tests/test-issue1102.t Tue Oct 04 14:33:31 2022 +0200
+++ b/tests/test-issue1102.t Mon Oct 10 11:28:19 2022 -0400
@@ -14,4 +14,18 @@
tip 3:a49829c4fc11
t1 0:f7b1eb17ad24
+Ensure that the username access fails gracefully if assumptions about the
+environment made by python do not hold.
+
+#if windows
+ >>> import os
+ >>> from mercurial import util
+ >>> os.environ.pop('LOGNAME', None) and None
+ >>> os.environ.pop('USER', None) and None
+ >>> os.environ.pop('LNAME', None) and None
+ >>> os.environ.pop('USERNAME', None) and None
+ >>> print(util.username())
+ None
+#endif
+
$ cd ..