Skip to content

Commit 65c4425

Browse files
ijonblinkov
authored andcommitted
tests/library: separate fixtures from harness (#15437)
`ydb/tests/library/harness/ydb_fixtures` -> `ydb/tests/library/fixtures`. Move module with pytest fixtures out of `ydb/tests/library/harness` and make it a separate (but dependent) library. Part of the `harness` (namely `ydbd` launching framework: `Daemon`, runner etc), is widely used outside of ydb tests, and some of that uses still require py2 compatibility (so that `harness` must run under py2). ydb's own tests (`ydb/tests/functional`) are all pure py3, so requirement for the test fixtures to be py2 compatible is excessive.
1 parent b8aa7f5 commit 65c4425

21 files changed

+200
-22
lines changed

ydb/tests/functional/audit/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# but somehow it does not
33
#
44
# for ydb_{cluster, database, ...} fixture family
5-
pytest_plugins = 'ydb.tests.library.harness.ydb_fixtures'
5+
pytest_plugins = 'ydb.tests.library.fixtures'

ydb/tests/functional/audit/test_auditlog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from ydb import Driver, DriverConfig, SessionPool
1414
from ydb.draft import DynamicConfigClient
1515
from ydb.tests.library.harness.util import LogLevels
16-
from ydb.tests.library.harness.ydb_fixtures import ydb_database_ctx
16+
from ydb.tests.library.fixtures import ydb_database_ctx
1717

1818
logger = logging.getLogger(__name__)
1919

ydb/tests/functional/audit/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ DEPENDS(
2323

2424
PEERDIR(
2525
ydb/tests/library
26+
ydb/tests/library/fixtures
2627
ydb/tests/oss/ydb_sdk_import
2728
ydb/public/sdk/python
2829
)

ydb/tests/functional/rename/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# but somehow it does not
33
#
44
# for ydb_{cluster, database, ...} fixture family
5-
pytest_plugins = 'ydb.tests.library.harness.ydb_fixtures'
5+
pytest_plugins = 'ydb.tests.library.fixtures'

ydb/tests/functional/rename/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ DEPENDS(
3232

3333
PEERDIR(
3434
ydb/tests/library
35+
ydb/tests/library/fixtures
3536
ydb/tests/oss/ydb_sdk_import
3637
ydb/public/sdk/python
3738
contrib/python/tornado/tornado-4

ydb/tests/functional/serverless/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# but somehow it does not
1010
#
1111
# for ydb_{cluster, database, ...} fixture family
12-
pytest_plugins = 'ydb.tests.library.harness.ydb_fixtures'
12+
pytest_plugins = 'ydb.tests.library.fixtures'
1313

1414

1515
logger = logging.getLogger(__name__)

ydb/tests/functional/serverless/test_serverless.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def enable_alter_database_create_hive_first(request):
6565
return request.param
6666

6767

68-
# ydb_fixtures.ydb_cluster_configuration local override
68+
# fixtures.ydb_cluster_configuration local override
6969
@pytest.fixture(scope='module')
7070
def ydb_cluster_configuration(enable_alter_database_create_hive_first):
7171
conf = copy.deepcopy(CLUSTER_CONFIG)

ydb/tests/functional/serverless/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ DEPENDS(
2222
PEERDIR(
2323
contrib/python/tornado/tornado-4
2424
ydb/tests/library
25+
ydb/tests/library/fixtures
2526
ydb/tests/oss/ydb_sdk_import
2627
ydb/public/sdk/python
2728
)

ydb/tests/functional/tenants/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# but somehow it does not
88
#
99
# for ydb_{cluster, database, ...} fixture family
10-
pytest_plugins = 'ydb.tests.library.harness.ydb_fixtures'
10+
pytest_plugins = 'ydb.tests.library.fixtures'
1111

1212

1313
@pytest.fixture(scope='module')

ydb/tests/functional/tenants/test_auth_system_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
)
5050

5151

52-
# ydb_fixtures.ydb_cluster_configuration local override
52+
# fixtures.ydb_cluster_configuration local override
5353
@pytest.fixture(scope='module')
5454
def ydb_cluster_configuration():
5555
conf = copy.deepcopy(CLUSTER_CONFIG)

0 commit comments

Comments
 (0)