2from pathlib
import Path
3from typing
import Optional
6from selfie_lib
import Mode
10 """API for configuring the selfie plugin, you can set its values like this https://docs.pytest.org/en/7.1.x/reference/customize.html#configuration-file-formats"""
17 """Allow multiple equivalent writes to one location."""
22 """Defaults to None, which means that snapshots are stored right next to the test that created them."""
27 """Returns the root folder for storing snapshots. Set by https://docs.pytest.org/en/7.1.x/reference/customize.html#finding-the-rootdir"""
30 def calc_mode(self) -> Mode:
31 override = os.getenv("selfie") or os.getenv("SELFIE") # noqa: SIM112
33 # Convert the mode to lowercase and match it with the Mode enum
35 return Mode[override.lower()]
37 raise ValueError(f"No such mode: {override}") from None
39 ci = os.getenv("ci") or os.getenv("CI") # noqa: SIM112
40 if ci and ci.lower() == "true":
43 return Mode.interactive
46class SelfieSettingsSmuggleError(SelfieSettingsAPI):
47 def __init__(self, error: BaseException):
__init__(self, pytest.Config config)
Optional[str] snapshot_folder_name(self)
bool allow_multiple_equivalent_writes_to_one_location(self)