diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index e07abe8..50a9b80 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -38,7 +38,7 @@ jobs: - name: Run tests run: | - poetry run pytest + poetry run pytest --reruns 3 # githubs playwright sometimes fails - name: Build package run: | diff --git a/poetry.lock b/poetry.lock index 8bd3ca8..b6dc3e2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1039,6 +1039,21 @@ tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-rerunfailures" +version = "14.0" +description = "pytest plugin to re-run tests to eliminate flaky failures" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-rerunfailures-14.0.tar.gz", hash = "sha256:4a400bcbcd3c7a4ad151ab8afac123d90eca3abe27f98725dc4d9702887d2e92"}, + {file = "pytest_rerunfailures-14.0-py3-none-any.whl", hash = "sha256:4197bdd2eaeffdbf50b5ea6e7236f47ff0e44d1def8dae08e409f536d84e7b32"}, +] + +[package.dependencies] +packaging = ">=17.1" +pytest = ">=7.2" + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -1470,4 +1485,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "327fb492bf27bd4f8a072f9bbff5cb046f3d7ab699606be23da80f0f5e84cc24" +content-hash = "d7aa0b9463622016afa8094352a42afaf3ec564d489c5d4016db02b9a31adf61" diff --git a/pyproject.toml b/pyproject.toml index acf76d8..a9b5a54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ ruff = "^0.4.4" pytest = "^8.2.0" python-dotenv = "^1.0.1" playwright = "^1.43.0" +pytest-rerunfailures = "^14.0" [build-system] requires = ["poetry-core"] diff --git a/tests/1_basic_test.py b/tests/1_basic_test.py index bccb47b..42f6201 100644 --- a/tests/1_basic_test.py +++ b/tests/1_basic_test.py @@ -72,7 +72,6 @@ def test_text(): def test_number_input(): - sleep(0) with sync_playwright() as playwright: write_py_script( contents="""