# HG changeset patch # User drewp@bigasterisk.com # Date 1710617120 25200 # Node ID d885fce5e4e763efa7ef241a34e38ea328a5af5e # Parent b34cd6619316772915c48cafdbbd03ac5f414f66 try to reduce warnings about leaked sessions diff -r b34cd6619316 -r d885fce5e4e7 examples/run_server_make_request.py --- a/examples/run_server_make_request.py Sat Mar 16 12:11:32 2024 -0700 +++ b/examples/run_server_make_request.py Sat Mar 16 12:25:20 2024 -0700 @@ -16,8 +16,10 @@ return self async def __aexit__(self, exc_type, exc, tb): + await self._session.close() self.subprocess.terminate() await self.subprocess.wait() + async def get(self, url: str) -> aiohttp.ClientResponse: while True: try: diff -r b34cd6619316 -r d885fce5e4e7 pretxncommit.sh --- a/pretxncommit.sh Sat Mar 16 12:11:32 2024 -0700 +++ b/pretxncommit.sh Sat Mar 16 12:25:20 2024 -0700 @@ -2,7 +2,6 @@ # e2e test including lib installs and test suite -HG_NODE=${HG_NODE:-tip} echo node = $HG_NODE SRC_DIR=`pwd` @@ -15,14 +14,18 @@ } -# $STAGE_DIR shall have the exact state to be committed. +# If you're running pretxnsubmit.sh outside of a commit... +if [[ -z $HG_NODE ]]; then + echo "using src and test code from $SRC_DIR" + STAGE_DIR=$SRC_DIR +else + echo "using pre-commit code from -r $HG_NODE" + STAGE_DIR=$WORK_DIR/stage + hg clone -r $HG_NODE $SRC_DIR $STAGE_DIR +fi -STAGE_DIR=$WORK_DIR/stage -hg clone -r $HG_NODE $SRC_DIR $STAGE_DIR - - -# TEST_PROJECT depends on rdferry from STAGE_DIR - +# TEST_PROJECT depends on rdferry being installed +# from STAGE_DIR. TEST_PROJECT_DIR=$WORK_DIR/test_project mkdir $TEST_PROJECT_DIR cd $TEST_PROJECT_DIR @@ -31,8 +34,8 @@ pdm add $STAGE_DIR pytest pytest-asyncio aiohttp pdm run python -c 'import rdferry; print(f"using {rdferry}")' -# pretend the example code is test project's code -cp -a ../stage/examples . +# Pretend the example code is test project's code. +cp -a $STAGE_DIR/examples . pdm run pytest examples rm -r $WORK_DIR