Skip to content

Commit

Permalink
Disable coverage for import test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Nov 15, 2023
1 parent b1c04c1 commit 9b56ee2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions py-polars/tests/unit/test_polars_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
MAX_ALLOWED_IMPORT_TIME = 200_000 # << microseconds


def _import_time_from_frame(tm: pl.DataFrame) -> int:
def _import_time_from_frame(tm: pl.DataFrame) -> int: # pragma: no cover
return int(
tm.filter(pl.col("import").str.strip_chars() == "polars")
.select("cumulative_time")
.item()
)


def _import_timings() -> bytes:
def _import_timings() -> bytes: # pragma: no cover
# assemble suitable command to get polars module import timing;
# run in a separate process to ensure clean timing results.
cmd = f'{sys.executable} -X importtime -c "import polars"'
Expand All @@ -35,7 +35,9 @@ def _import_timings() -> bytes:
)


def _import_timings_as_frame(n_tries: int) -> tuple[pl.DataFrame, int]:
def _import_timings_as_frame( # pragma: no cover
n_tries: int,
) -> tuple[pl.DataFrame, int]:
import_timings = []
for _ in range(n_tries):
df_import = (
Expand Down Expand Up @@ -68,7 +70,7 @@ def _import_timings_as_frame(n_tries: int) -> tuple[pl.DataFrame, int]:

@pytest.mark.skipif(sys.platform == "win32", reason="Unreliable on Windows")
@pytest.mark.slow()
def test_polars_import() -> None:
def test_polars_import() -> None: # pragma: no cover
# up-front compile '.py' -> '.pyc' before timing
polars_path = Path(pl.__file__).parent
compileall.compile_dir(polars_path, quiet=1)
Expand Down

0 comments on commit 9b56ee2

Please sign in to comment.