Skip to content

Commit a4ca00d

Browse files
authored
Merge pull request #331 from tylerriccio33/no-pytest-local
Add "test-core" target for quick and dirty local CI
2 parents 5a4675b + a85682b commit a4ca00d

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ test:
1010
--reruns 3 \
1111
--reruns-delay 1
1212

13+
.PHONY: test-core
14+
test-core: ## Run core libraries only; useful for local CI
15+
@SKIP_PYSPARK_TESTS=1 \
16+
SKIP_SQLITE_TESTS=1 \
17+
SKIP_PARQUET_TESTS=1 \
18+
uv run pytest \
19+
--cov=pointblank \
20+
--cov-report=term-missing \
21+
--randomly-seed 123 \
22+
-n auto \
23+
--durations=10
24+
25+
1326
test-update:
1427
pytest --snapshot-update
1528

tests/test_validate.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ class StrEnum(str, Enum):
7575
except ImportError:
7676
PYSPARK_AVAILABLE = False
7777

78+
## If we specifically disable tests in pytest set the availability to False
79+
if os.environ.get("SKIP_PYSPARK_TESTS", "").lower() in ("true", "1", "yes"):
80+
PYSPARK_AVAILABLE = False
81+
SQLITE_AVAILABLE = True
82+
if os.environ.get("SKIP_SQLITE_TESTS", "").lower() in ("true", "1", "yes"):
83+
SQLITE_AVAILABLE = False
84+
PARQUET_AVAILABLE = True
85+
if os.environ.get("SKIP_PARQUET_TESTS", "").lower() in ("true", "1", "yes"):
86+
PARQUET_AVAILABLE = False
7887

7988
from great_tables import vals
8089
import great_tables as GT
@@ -180,12 +189,15 @@ def get_spark_session():
180189
TBL_LIST = [
181190
"tbl_pd",
182191
"tbl_pl",
183-
"tbl_parquet",
184192
"tbl_duckdb",
185-
"tbl_sqlite",
186193
]
187194

188-
# Add PySpark to lists if available
195+
if PARQUET_AVAILABLE:
196+
TBL_LIST.append("tbl_parquet")
197+
198+
if SQLITE_AVAILABLE:
199+
TBL_LIST.append("tbl_sqlite")
200+
189201
if PYSPARK_AVAILABLE:
190202
TBL_LIST.append("tbl_pyspark")
191203

0 commit comments

Comments
 (0)