@@ -20,17 +20,6 @@ def is_windows() -> bool:
2020 return os .name == "nt"
2121
2222
23- @pytest .fixture (scope = "function" )
24- def is_windows_server_2019 (is_windows : bool ) -> bool :
25- """Returns True if running on Windows Server 2019."""
26-
27- if not is_windows :
28- return False
29-
30- windows_caption = subprocess .check_output (["wmic" , "os" , "get" , "Caption" ], text = True )
31- return "Windows Server 2019" in windows_caption
32-
33-
3423@pytest .fixture (scope = "function" )
3524def connection_uri () -> str :
3625 """Read and return connection URI from environment."""
@@ -108,27 +97,24 @@ def test_server_encoding(connection: psycopg.Connection):
10897 assert connection .execute ("SHOW SERVER_ENCODING" ).fetchone ()[0 ] == "UTF8"
10998
11099
111- def test_locale (connection : psycopg .Connection , is_windows_server_2019 : bool ):
112- """Test that PostgreSQL's locale matches the one we paased to initdb."""
113-
114- locale_exp = "en_US.UTF-8"
100+ def test_locale (connection : psycopg .Connection ):
101+ """Test that PostgreSQL's locale matches the one we passed to initdb."""
115102
116- if is_windows_server_2019 :
117- locale_exp = "en-US"
103+ locale_expected = "en_US.UTF-8"
118104
119105 record = connection \
120106 .execute ("SELECT datcollate, datctype FROM pg_database WHERE datname = 'template0'" ) \
121107 .fetchone ()
122108 assert record
123- assert locale .normalize (record [0 ]) == locale_exp
124- assert locale .normalize (record [1 ]) == locale_exp
109+ assert locale .normalize (record [0 ]) == locale_expected
110+ assert locale .normalize (record [1 ]) == locale_expected
125111
126112 record = connection \
127113 .execute ("SELECT datcollate, datctype FROM pg_database WHERE datname = 'template1'" ) \
128114 .fetchone ()
129115 assert record
130- assert locale .normalize (record [0 ]) == locale_exp
131- assert locale .normalize (record [1 ]) == locale_exp
116+ assert locale .normalize (record [0 ]) == locale_expected
117+ assert locale .normalize (record [1 ]) == locale_expected
132118
133119
134120def test_environment_variables (is_windows : bool ):
0 commit comments