Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tests are based on pytest #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f37c299
Using pytest [pytest.raises]
dmitry-lipetsk Feb 23, 2025
53e468e
Using pytest [pytest.skip]
dmitry-lipetsk Feb 23, 2025
12d702a
Using pytest [assertIsNotNone]
dmitry-lipetsk Feb 23, 2025
1cb664e
Using pytest [assertFalse]
dmitry-lipetsk Feb 23, 2025
e2e7e8b
Using pytest [assertTrue]
dmitry-lipetsk Feb 23, 2025
89784a8
Using pytest [assertEqual]
dmitry-lipetsk Feb 23, 2025
2252d60
Using pytest [assertNotEqual]
dmitry-lipetsk Feb 23, 2025
e8aad3d
Using pytest [assertGreaterEqual]
dmitry-lipetsk Feb 23, 2025
eaaa276
Using pytest [assertGreater]
dmitry-lipetsk Feb 23, 2025
4afbe00
Using pytest [assertIn]
dmitry-lipetsk Feb 23, 2025
a8e57ae
Using pytest [assertListEqual]
dmitry-lipetsk Feb 23, 2025
df199b9
unittest is not used
dmitry-lipetsk Feb 23, 2025
a82cf3d
Code style (flake8)
dmitry-lipetsk Feb 23, 2025
9745bc4
Merge commit '38b3dc3697d229b6668217f2f57825379c7f2e23' into D2025022…
dmitry-lipetsk Feb 23, 2025
27c4f40
Execution signature is removed
dmitry-lipetsk Feb 24, 2025
ae41d16
run_tests.sh installs pytest
dmitry-lipetsk Feb 24, 2025
a14b3d7
run_tests.sh is updated
dmitry-lipetsk Feb 24, 2025
e6f4448
Total refactoring of tests
dmitry-lipetsk Feb 24, 2025
842bc08
Code style (flake8)
dmitry-lipetsk Feb 24, 2025
d9afdcc
Merge commit 'de738f9fd8d52345677903bface575d41cbe539c' into D2025022…
dmitry-lipetsk Feb 24, 2025
027d2ea
Merge branch 'D20250224_002--os_ops-in-free_utilities' into D20250223…
dmitry-lipetsk Feb 24, 2025
969e49d
Root __init__.py is added
dmitry-lipetsk Feb 24, 2025
6e2820d
Code style (flake8)
dmitry-lipetsk Feb 24, 2025
588b28b
Merge remote-tracking branch 'origin/D20250224_002--os_ops-in-free_ut…
dmitry-lipetsk Feb 24, 2025
e4e8909
pytest.ini is added
dmitry-lipetsk Feb 24, 2025
66860d0
TestgresTests::test_ports_management is corrected
dmitry-lipetsk Feb 24, 2025
aaaa677
coding: utf-8
dmitry-lipetsk Feb 24, 2025
60bb4c5
Cleanup
dmitry-lipetsk Feb 24, 2025
2d2532c
CI runs all the tests of testgres.
dmitry-lipetsk Feb 24, 2025
537a9ac
Add install ssh
Feb 24, 2025
1f99813
Revert "Add install ssh"
dmitry-lipetsk Feb 25, 2025
41455d6
Revert "CI runs all the tests of testgres."
dmitry-lipetsk Feb 25, 2025
1c43810
Merge commit '669e134ff65b99cd285500e5f362633fc8d50e4e' into D2025022…
dmitry-lipetsk Feb 25, 2025
47a51a8
Test of probackup plugin is restored
dmitry-lipetsk Feb 25, 2025
f7f163d
The test suite of a probackup plugin is based on pytest
dmitry-lipetsk Feb 25, 2025
ed7b187
Probackup plugin is updated
dmitry-lipetsk Feb 25, 2025
8af4a49
CI test use 4 cores
dmitry-lipetsk Feb 25, 2025
d35ca43
testgres.plugins.probackup2.Init was restored [thanks to Yuri Sokolov]
dmitry-lipetsk Feb 25, 2025
181126b
pytest.ini is updated [testpaths]
dmitry-lipetsk Feb 25, 2025
d08f659
test_child_pids (local, remote) is updated
dmitry-lipetsk Feb 25, 2025
e803146
test_child_process_dies is updated
dmitry-lipetsk Feb 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Total refactoring of tests
- TestgresRemoteTests does not use global variables and code
- Explicit work with ..testgres folder
  • Loading branch information
dmitry-lipetsk committed Feb 24, 2025
commit e6f4448bd992cbe28f67cccfae40c008bc5a3596
4 changes: 2 additions & 2 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export VIRTUAL_ENV_DISABLE_PROMPT=1
source $VENV_PATH/bin/activate

# install utilities
$PIP install coverage flake8 psutil Sphinx pytest pytest-xdist
$PIP install coverage flake8 psutil Sphinx pytest pytest-xdist psycopg2 six psutil

# install testgres' dependencies
export PYTHONPATH=$(pwd)
$PIP install .
# $PIP install .

# test code quality
flake8 .
Expand Down
6 changes: 3 additions & 3 deletions tests/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import re
import tempfile

from testgres import ExecUtilException
from testgres import InvalidOperationException
from testgres import LocalOperations
from ..testgres import ExecUtilException
from ..testgres import InvalidOperationException
from ..testgres import LocalOperations

from .helpers.run_conditions import RunConditions

Expand Down
8 changes: 4 additions & 4 deletions tests/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import re
import tempfile

from testgres import ExecUtilException
from testgres import InvalidOperationException
from testgres import RemoteOperations
from testgres import ConnectionParams
from ..testgres import ExecUtilException
from ..testgres import InvalidOperationException
from ..testgres import RemoteOperations
from ..testgres import ConnectionParams


class TestRemoteOperations:
Expand Down
22 changes: 11 additions & 11 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import re
import subprocess
import tempfile
import testgres
import time
import six
import pytest
Expand All @@ -14,7 +13,9 @@
from contextlib import contextmanager
from shutil import rmtree

from testgres import \
from .. import testgres

from ..testgres import \
InitNodeException, \
StartNodeException, \
ExecUtilException, \
Expand All @@ -25,31 +26,32 @@
InvalidOperationException, \
NodeApp

from testgres import \
from ..testgres import \
TestgresConfig, \
configure_testgres, \
scoped_config, \
pop_config

from testgres import \
from ..testgres import \
NodeStatus, \
ProcessType, \
IsolationLevel, \
get_new_node

from testgres import \
from ..testgres import \
get_bin_path, \
get_pg_config, \
get_pg_version

from testgres import \
from ..testgres import \
First, \
Any

# NOTE: those are ugly imports
from testgres import bound_ports
from testgres.utils import PgVer, parse_pg_version
from testgres.node import ProcessProxy
from ..testgres import bound_ports
from ..testgres.utils import PgVer, parse_pg_version
from ..testgres.utils import file_tail
from ..testgres.node import ProcessProxy


def pg_version_ge(version):
Expand Down Expand Up @@ -874,8 +876,6 @@ def test_auto_name(self):
assert ('testgres' in r.name)

def test_file_tail(self):
from testgres.utils import file_tail

s1 = "the quick brown fox jumped over that lazy dog\n"
s2 = "abc\n"
s3 = "def\n"
Expand Down
Loading