Skip to content

Commit

Permalink
feat: utilize cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Jan 6, 2025
1 parent 7ea4f32 commit edd2d7b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ape/pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,16 +604,11 @@ def isolation(self, scope: Scope) -> Iterator[None]:
else:
yield

# NOTE: self._supported may have gotten set to False
# someplace else _after_ snapshotting succeeded.
if not self.supported:
return

self.restore(scope)

def set_snapshot(self, scope: Scope):
# Also can be used to re-set snapshot.
if not self.supported:
if not self.supported or not self.config_wrapper.get_isolation(scope):
return

try:
Expand All @@ -640,6 +635,11 @@ def take_snapshot(self) -> Optional["SnapshotID"]:

@allow_disconnected
def restore(self, scope: Scope):
# NOTE: self._supported may have gotten set to False
# someplace else _after_ snapshotting succeeded.
if not self.supported or not self.config_wrapper.get_isolation(scope):
return

snapshot_id = self.snapshots.get_snapshot_id(scope)
if snapshot_id is None:
return
Expand Down

0 comments on commit edd2d7b

Please sign in to comment.