diff --git a/pytest.ini b/pytest.ini index c94eabc2..9f5fa375 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ [pytest] -testpaths = ["./tests", "./testgres/plugins/pg_probackup2/pg_probackup2/tests"] +testpaths = tests testgres/plugins/pg_probackup2/pg_probackup2/tests addopts = --strict-markers markers = #log_file = logs/pytest.log diff --git a/tests/test_testgres_common.py b/tests/test_testgres_common.py index 49740b61..f42964c8 100644 --- a/tests/test_testgres_common.py +++ b/tests/test_testgres_common.py @@ -10,7 +10,11 @@ from ..testgres import ProcessType from ..testgres import NodeStatus from ..testgres import IsolationLevel -from ..testgres import TestgresException + +# New name prevents to collect test-functions in TestgresException and fixes +# the problem with pytest warning. +from ..testgres import TestgresException as testgres_TestgresException + from ..testgres import InitNodeException from ..testgres import StartNodeException from ..testgres import QueryException @@ -336,7 +340,7 @@ def LOCAL__check_auxiliary_pids__multiple_attempts( with __class__.helper__get_node(os_ops).init().start() as master: # master node doesn't have a source walsender! - with pytest.raises(expected_exception=TestgresException): + with pytest.raises(expected_exception=testgres_TestgresException): master.source_walsender with master.connect() as con: @@ -366,7 +370,7 @@ def LOCAL__check_auxiliary_pids__multiple_attempts( replica.stop() # there should be no walsender after we've stopped replica - with pytest.raises(expected_exception=TestgresException): + with pytest.raises(expected_exception=testgres_TestgresException): replica.source_walsender def test_exceptions(self): @@ -1013,7 +1017,7 @@ def test_replication_slots(self, os_ops: OsOperations): replica.execute('select 1') # cannot create new slot with the same name - with pytest.raises(expected_exception=TestgresException): + with pytest.raises(expected_exception=testgres_TestgresException): node.replicate(slot='slot1') def test_incorrect_catchup(self, os_ops: OsOperations): @@ -1022,7 +1026,7 @@ def test_incorrect_catchup(self, os_ops: OsOperations): node.init(allow_streaming=True).start() # node has no master, can't catch up - with pytest.raises(expected_exception=TestgresException): + with pytest.raises(expected_exception=testgres_TestgresException): node.catchup() def test_promotion(self, os_ops: OsOperations):