@@ -20,17 +20,6 @@ def is_windows() -> bool:
20
20
return os .name == "nt"
21
21
22
22
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
-
34
23
@pytest .fixture (scope = "function" )
35
24
def connection_uri () -> str :
36
25
"""Read and return connection URI from environment."""
@@ -108,27 +97,24 @@ def test_server_encoding(connection: psycopg.Connection):
108
97
assert connection .execute ("SHOW SERVER_ENCODING" ).fetchone ()[0 ] == "UTF8"
109
98
110
99
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."""
115
102
116
- if is_windows_server_2019 :
117
- locale_exp = "en-US"
103
+ locale_expected = "en_US.UTF-8"
118
104
119
105
record = connection \
120
106
.execute ("SELECT datcollate, datctype FROM pg_database WHERE datname = 'template0'" ) \
121
107
.fetchone ()
122
108
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
125
111
126
112
record = connection \
127
113
.execute ("SELECT datcollate, datctype FROM pg_database WHERE datname = 'template1'" ) \
128
114
.fetchone ()
129
115
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
132
118
133
119
134
120
def test_environment_variables (is_windows : bool ):
0 commit comments