Commit 4c33f5e5 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Shortcut Site.running in tests

parent 4aacffc9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ class Site:
		self.backend = backend
		self.database = database
		self._address: IPv4Address|None = None
		self._running = False

	@classmethod
	@contextmanager
@@ -141,10 +142,15 @@ class Site:
		"""
		Start all the services and configure the network
		"""
		if self._running:
			yield self
			return
		self._running = True
		with self.database.started(), self.backend.started(), self.frontend.started():
			try:
				yield self
			finally:
				self._running = False
				self._address = None

	@property