FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
asyncpg/tests/test__environment.py at get_buffer · MagicStack/asyncpg · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
MagicStack
/
asyncpg
Public
Notifications
You must be signed in to change notification settings
Fork
467
Star
8.1k
Code
Issues
257
Pull requests
50
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
asyncpg
/
tests
/
test__environment.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (22 loc) · 917 Bytes
Breadcrumbs
asyncpg
/
tests
/
test__environment.py
Copy path
File metadata and controls
29 lines (22 loc) · 917 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright (C) 2016-present the asyncpg authors and contributors
# <see AUTHORS file>
#
# This module is part of asyncpg and is released under
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
import
os
import
unittest
import
asyncpg
import
asyncpg
.
serverversion
from
asyncpg
import
_testbase
as
tb
class
TestEnvironment
(
tb
.
ConnectedTestCase
):
@
unittest
.
skipIf
(
not
os
.
environ
.
get
(
'PGVERSION'
),
"environ[PGVERSION] is not set"
)
async
def
test_environment_server_version
(
self
):
pgver
=
os
.
environ
.
get
(
'PGVERSION'
)
env_ver
=
asyncpg
.
serverversion
.
split_server_version_string
(
pgver
)
srv_ver
=
self
.
con
.
get_server_version
()
self
.
assertEqual
(
env_ver
[:
2
],
srv_ver
[:
2
],
'Expecting PostgreSQL version {pgver}, got {maj}.{min}.'
.
format
(
pgver
=
pgver
,
maj
=
srv_ver
.
major
,
min
=
srv_ver
.
minor
)
)
Back
|
FazBrowse Home
|
New Git URL