diff --git a/justfile b/justfile index d2f8803..d7d7630 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -PROJECTS := "pytest-backend" +PROJECTS := "pytest-slc pytest-backend pytest-saas pytest-itde" # Default target default: diff --git a/pytest-backend/test/integration/pytest_backend_test.py b/pytest-backend/test/integration/pytest_backend_test.py index 1036958..094f014 100644 --- a/pytest-backend/test/integration/pytest_backend_test.py +++ b/pytest-backend/test/integration/pytest_backend_test.py @@ -5,31 +5,27 @@ pytest_plugins = ["pytester"] +_test_code = dedent(""" + import pyexasol + import exasol.bucketfs as bfs -@pytest.mark.parametrize( - "test_code", - [ - dedent(""" - import pyexasol - def test_backend_aware_database_params(backend_aware_database_params): - conn = pyexasol.connect(**backend_aware_database_params) - res = conn.execute('SELECT SESSION_ID FROM SYS.EXA_ALL_SESSIONS;').fetchall() - assert res - """), - dedent(""" - import exasol.bucketfs as bfs - def test_backend_aware_bucketfs_params(backend_aware_bucketfs_params): - bfs_path = bfs.path.build_path(**backend_aware_bucketfs_params, path='plugin_test') - file_content = b'In God We Trust' - bfs_path.write(file_content) - data_back = b''.join(bfs_path.read()) - bfs_path.rm() - assert data_back == file_content - """), - ], ids=["database", "bucketfs"] -) -def test_pytest_backend(pytester, test_code): - pytester.makepyfile(test_code) + def test_backend_aware_database_params(backend_aware_database_params): + conn = pyexasol.connect(**backend_aware_database_params) + res = conn.execute('SELECT SESSION_ID FROM SYS.EXA_ALL_SESSIONS;').fetchall() + assert res + + def test_backend_aware_bucketfs_params(backend_aware_bucketfs_params): + bfs_path = bfs.path.build_path(**backend_aware_bucketfs_params, path='plugin_test') + file_content = b'In God We Trust' + bfs_path.write(file_content) + data_back = b''.join(bfs_path.read()) + bfs_path.rm() + assert data_back == file_content +""") + + +def test_pytest_backend(pytester): + pytester.makepyfile(_test_code) result = pytester.runpytest(BACKEND_OPTION, BACKEND_ONPREM, BACKEND_OPTION, BACKEND_SAAS) assert result.ret == pytest.ExitCode.OK - result.assert_outcomes(passed=2, skipped=0) + result.assert_outcomes(passed=4, skipped=0)