Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Nov 21, 2023
1 parent 03650fb commit 05d5e14
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/plan_optimization/# test_predicate_pushdown_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

sys.path.insert(1, os.path.join(sys.path[0], "../.."))

from tests.tools import is_arm, is_mac, is_windows, skip_if
from tests.tools import is_arm, is_mac, is_windows, is_version, skip_if

import opteryx
from opteryx.connectors import SqlConnector
Expand All @@ -23,8 +23,7 @@
)


# skip to reduce contention
@skip_if(is_arm() or is_windows() or is_mac())
@skip_if(is_arm() or is_mac() or is_windows() or not is_version("3.9"))
def test_predicate_pushdowns_postgres_eq():
"""
This is the same test as the collection pushdown - but on a different dataset
Expand Down
2 changes: 2 additions & 0 deletions tests/storage/test_sql_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

import opteryx
from opteryx.connectors import SqlConnector
from tests.tools import is_arm, is_mac, is_windows, is_version, skip_if

POSTGRES_PASSWORD = os.environ.get("POSTGRES_PASSWORD")
POSTGRES_USER = os.environ.get("POSTGRES_USER")


@skip_if(is_arm() or is_mac() or is_windows() or not is_version("3.9"))
def test_postgres_storage():
opteryx.register_store(
"pg",
Expand Down
11 changes: 11 additions & 0 deletions tests/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ def is_pypy(): # pragma: no cover
return platform.python_implementation() == "PyPy"


def is_version(version):
import sys

if len(version) == 0:
raise Exception("is_version needs a version")

Check warning on line 25 in tests/tools.py

View check run for this annotation

Codecov / codecov/patch

tests/tools.py#L25

Added line #L25 was not covered by tests
if version[-1] != ".":
version += "."
print(sys.version)
return (sys.version.split(" ")[0] + ".").startswith(version)


def skip(func): # pragma: no cover
@wraps(func)
def wrapper(*args, **kwargs):
Expand Down

0 comments on commit 05d5e14

Please sign in to comment.