-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reflect changes from ESSS/pytest-regressions#35 * Run stubtest as part of mypy testenv. * Updated config files. * Linting. * Linting * Updated files with 'repo_helper'. (#2) Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Reflect changes from ESSS/pytest-regressions#35 * Linting. * Don't upload coverage. * Updated config files. * Linting. * Updated config files. Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6f8a6cd
commit df07824
Showing
5 changed files
with
51 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# stdlib | ||
from pathlib import Path | ||
from typing import Any, Dict, Mapping, Optional | ||
|
||
# 3rd party | ||
import pandas # type: ignore | ||
from _pytest.fixtures import FixtureRequest | ||
|
||
|
||
class DataFrameRegressionFixture: | ||
""" | ||
Pandas DataFrame Regression fixture implementation used on dataframe_regression fixture. | ||
""" | ||
|
||
DISPLAY_PRECISION: int = 17 # Decimal places | ||
DISPLAY_WIDTH: int = 1000 # Max. Chars on outputs | ||
DISPLAY_MAX_COLUMNS: int = 1000 # Max. Number of columns (see #3) | ||
|
||
request: FixtureRequest | ||
datadir: Path | ||
original_datadir: Path | ||
_force_regen: bool | ||
_tolerances_dict: Dict[str, Any] | ||
_default_tolerance: Dict[str, float] | ||
_pandas_display_options: Dict[str, float] | ||
|
||
def __init__(self, datadir: Path, original_datadir: Path, request: FixtureRequest): ... | ||
def _check_data_types(self, key: str, obtained_column: pandas.Series, expected_column: pandas.Series) -> None: ... | ||
def _check_data_shapes(self, obtained_column: pandas.Series, expected_column: pandas.Series) -> None: ... | ||
def _check_fn(self, obtained_filename: str, expected_filename: str) -> None: ... | ||
def _dump_fn(self, data_object: pandas.DataFrame, filename: str) -> None: ... | ||
|
||
def check( | ||
self, | ||
data_frame: pandas.DataFrame, | ||
basename: Optional[str] = None, | ||
fullpath: Optional[str] = None, | ||
tolerances: Optional[Mapping[str, Any]] = None, | ||
default_tolerance: Optional[Mapping[str, float]] = None, | ||
) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters