Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,173 changes: 7,969 additions & 204 deletions pixi.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ datajoint = "datajoint.cli:cli"
test = [
"pytest",
"pytest-cov",
"hypothesis",
"requests",
"faker",
"matplotlib",
Expand All @@ -108,6 +109,7 @@ viz = ["matplotlib", "ipython"]
test = [
"pytest",
"pytest-cov",
"hypothesis",
"requests",
"faker",
"matplotlib",
Expand All @@ -125,6 +127,7 @@ dev = [
# including test
"pytest",
"pytest-cov",
"hypothesis",
"polars>=0.20.0",
"pyarrow>=14.0.0",
]
Expand Down
23 changes: 23 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
import logging
import os
from os import remove
from pathlib import Path
from typing import Dict, List

import certifi
import pytest
import urllib3
from hypothesis import settings
from hypothesis.database import DirectoryBasedExampleDatabase

import datajoint as dj
from datajoint.errors import DataJointError
Expand All @@ -35,6 +38,26 @@
logger = logging.getLogger(__name__)


# =============================================================================
# Hypothesis Profiles
# =============================================================================
# Select a profile with HYPOTHESIS_PROFILE=dev|ci|thorough. Without it, the
# profile is "ci" when the CI environment variable is set (GitHub Actions sets
# it) and "dev" otherwise. The example counts are for the model-level
# properties (tests/unit/test_expand_spec.py); property tests that run against
# a database set their own, smaller max_examples.
# dev fast local runs
# ci 500 examples, the same examples on every run
# thorough 2000 random examples; failing examples are saved under
# .hypothesis/ (gitignored) and replayed first on the next run.
# Run it before each Diagram.expand merge and before a release tag.
_HYPOTHESIS_DB = DirectoryBasedExampleDatabase(str(Path(__file__).resolve().parent.parent / ".hypothesis" / "examples"))
settings.register_profile("dev", max_examples=50, deadline=None, database=_HYPOTHESIS_DB)
settings.register_profile("ci", max_examples=500, derandomize=True, deadline=None, database=None, print_blob=True)
settings.register_profile("thorough", max_examples=2000, deadline=None, database=_HYPOTHESIS_DB)
settings.load_profile(os.environ.get("HYPOTHESIS_PROFILE") or ("ci" if os.environ.get("CI") else "dev"))


# =============================================================================
# Pytest Hooks
# =============================================================================
Expand Down
Loading