Skip to content
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

added pytest #36

Merged
merged 18 commits into from
Nov 7, 2023
Prev Previous commit
cr changes
  • Loading branch information
lynnro314 committed Nov 7, 2023
commit 826246862138738ab2521ebcdf13102b3b02ae25
5 changes: 2 additions & 3 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pyspark
from pyspark.sql import SparkSession
from pyspark.conf import SparkConf

import pytest

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove spaces

import lakefs_sdk
@@ -57,8 +56,8 @@ def lfs_client(pytestconfig):
repo_name = pytestconfig.getoption('--repository')
storage_namespace = pytestconfig.getoption('--storage_namespace')
lfs_client.internal_api.setup_comm_prefs(CommPrefsInput(feature_updates=False, security_updates=False, email=MOCK_EMAIL))
lfs_client.internal_api.setup(Setup(username="lynn",
lfs_client.internal_api.setup(Setup(username="admin",
key=AccessKeyCredentials(access_key_id=LAKEFS_ACCESS_KEY, secret_access_key=LAKEFS_SECRET_KEY)))
lfs_client.repositories_api.create_repository(
RepositoryCreation(name=repo_name, storage_namespace=storage_namespace))
return lfs_client
return lfs_client
2 changes: 1 addition & 1 deletion test/test_iceberg.py
Original file line number Diff line number Diff line change
@@ -56,4 +56,4 @@ def test_multiple_changes_and_merge(spark, lfs_client: lakefs_sdk.client.LakeFSC
lfs_client.refs_api.merge_into_branch(lakefs_repo, "test4", "test3")
df_source = spark.read.table("lakefs.test3.company.workers")
df_dest = spark.read.table("lakefs.test4.company.workers")
assert (df_source.schema == df_dest.schema) and (set(df_source.collect()) == set(df_dest.collect())), "test3 and test4 tables should be equal"
assert (df_source.schema == df_dest.schema) and (set(df_source.collect()) == set(df_dest.collect())), "test3 and test4 tables should be equal"