Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite6f4448

Browse files
Total refactoring of tests
- TestgresRemoteTests does not use global variables and code- Explicit work with ..testgres folder
1 parenta14b3d7 commite6f4448

File tree

5 files changed

+116
-99
lines changed

5 files changed

+116
-99
lines changed

‎run_tests.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ export VIRTUAL_ENV_DISABLE_PROMPT=1
2222
source$VENV_PATH/bin/activate
2323

2424
# install utilities
25-
$PIP install coverage flake8 psutil Sphinx pytest pytest-xdist
25+
$PIP install coverage flake8 psutil Sphinx pytest pytest-xdist psycopg2 six psutil
2626

2727
# install testgres' dependencies
2828
export PYTHONPATH=$(pwd)
29-
$PIP install.
29+
#$PIP install .
3030

3131
# test code quality
3232
flake8.

‎tests/test_local.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
importre
55
importtempfile
66

7-
fromtestgresimportExecUtilException
8-
fromtestgresimportInvalidOperationException
9-
fromtestgresimportLocalOperations
7+
from..testgresimportExecUtilException
8+
from..testgresimportInvalidOperationException
9+
from..testgresimportLocalOperations
1010

1111
from .helpers.run_conditionsimportRunConditions
1212

‎tests/test_remote.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
importre
55
importtempfile
66

7-
fromtestgresimportExecUtilException
8-
fromtestgresimportInvalidOperationException
9-
fromtestgresimportRemoteOperations
10-
fromtestgresimportConnectionParams
7+
from..testgresimportExecUtilException
8+
from..testgresimportInvalidOperationException
9+
from..testgresimportRemoteOperations
10+
from..testgresimportConnectionParams
1111

1212

1313
classTestRemoteOperations:

‎tests/test_simple.py‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
importre
33
importsubprocess
44
importtempfile
5-
importtestgres
65
importtime
76
importsix
87
importpytest
@@ -14,7 +13,9 @@
1413
fromcontextlibimportcontextmanager
1514
fromshutilimportrmtree
1615

17-
fromtestgresimport \
16+
from ..importtestgres
17+
18+
from ..testgresimport \
1819
InitNodeException, \
1920
StartNodeException, \
2021
ExecUtilException, \
@@ -25,31 +26,32 @@
2526
InvalidOperationException, \
2627
NodeApp
2728

28-
fromtestgresimport \
29+
from..testgresimport \
2930
TestgresConfig, \
3031
configure_testgres, \
3132
scoped_config, \
3233
pop_config
3334

34-
fromtestgresimport \
35+
from..testgresimport \
3536
NodeStatus, \
3637
ProcessType, \
3738
IsolationLevel, \
3839
get_new_node
3940

40-
fromtestgresimport \
41+
from..testgresimport \
4142
get_bin_path, \
4243
get_pg_config, \
4344
get_pg_version
4445

45-
fromtestgresimport \
46+
from..testgresimport \
4647
First, \
4748
Any
4849

4950
# NOTE: those are ugly imports
50-
fromtestgresimportbound_ports
51-
fromtestgres.utilsimportPgVer,parse_pg_version
52-
fromtestgres.nodeimportProcessProxy
51+
from ..testgresimportbound_ports
52+
from ..testgres.utilsimportPgVer,parse_pg_version
53+
from ..testgres.utilsimportfile_tail
54+
from ..testgres.nodeimportProcessProxy
5355

5456

5557
defpg_version_ge(version):
@@ -874,8 +876,6 @@ def test_auto_name(self):
874876
assert ('testgres'inr.name)
875877

876878
deftest_file_tail(self):
877-
fromtestgres.utilsimportfile_tail
878-
879879
s1="the quick brown fox jumped over that lazy dog\n"
880880
s2="abc\n"
881881
s3="def\n"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp