Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
amh4r committed Oct 22, 2023
1 parent 29a5e55 commit 4d415fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 2 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@


def pytest_configure(config: Config) -> None:
# dev_server.start()
return None
dev_server.start()


def pytest_unconfigure(config: Config) -> None:
# dev_server.stop()
return None
dev_server.stop()
6 changes: 5 additions & 1 deletion tests/dev_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ def _run() -> None:
)
self._process.communicate()

print(1)
self._thread = threading.Thread(target=_run)
print(2)
self._thread.start()
print(3)
self._thread.join(timeout=10)
print(4)

def stop(self) -> None:
if not self._enabled:
Expand All @@ -60,7 +64,7 @@ def stop(self) -> None:
raise Exception("thread is not alive")

self._process.terminate()
self._thread.join()
self._thread.join(timeout=10)


dev_server = _DevServer()

0 comments on commit 4d415fc

Please sign in to comment.