diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 14ae031..e688e7e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,22 +9,31 @@ jobs: deploy: runs-on: ubuntu-latest + permissions: + id-token: write # For PyPI trusted publishers. + contents: write # For release notes. steps: - uses: actions/checkout@v1 + - name: Set up Python uses: actions/setup-python@v1 with: python-version: "3.10" + - name: Install dependencies run: | python -m pip install --upgrade pip pip install build + - name: Build package run: | python -m build + - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@v1.8.5 + + - name: GitHub Release + uses: softprops/action-gh-release@v1 with: - user: __token__ - password: ${{ secrets.pypi_token }} + files: dist/* diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d677988..c531e46 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,9 @@ +0.5.2 +----- + +- New attribute ``AsyncTester.timeout_s``, with the timeout in seconds until ``start_and_wait`` + raises ``TimeoutError``. + 0.4.0 ----- diff --git a/src/qt_async_threads/pytest_plugin.py b/src/qt_async_threads/pytest_plugin.py index 038ecf3..3e41975 100644 --- a/src/qt_async_threads/pytest_plugin.py +++ b/src/qt_async_threads/pytest_plugin.py @@ -36,12 +36,15 @@ class AsyncTester: runner: QtAsyncRunner qtbot: QtBot + #: Timeout in seconds for ``QtBot.waitUntil`` during ``start_and_wait``. + timeout_s: int = 5 + def _get_wait_idle_timeout(self) -> int: """ Return the maximum amount of time we should wait for the runner to become idle, in ms. """ - timeout_s = 5 # This is the default timeout from pytest-qt. + timeout_s = self.timeout_s in_ci = os.environ.get("CI") == "true" in_debugger = sys.gettrace() is not None if in_debugger and not in_ci: