Skip to content

Commit

Permalink
Don't mark sqlite3.InterfaceError on pypy as flaky anymore (temporari…
Browse files Browse the repository at this point in the history
…ly?).

Also, replace flaky with pytest-rerunfailures.
  • Loading branch information
lemon24 committed Mar 9, 2024
1 parent 6cb6bca commit 8b9f49b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ tests = [
"pytest>=4",
"pytest-randomly",
"pytest-subtests",
"flaky",
"pytest-rerunfailures",
"coverage",
"pytest-cov",
"requests-mock",
Expand Down Expand Up @@ -153,7 +153,6 @@ markers = [
"requires_lxml: mark a test to only run in places where we have lxml.",
"apptest: mark a test as a web app test (skipped sometimes).",
]
addopts = "--no-success-flaky-report"
filterwarnings = [
"ignore:No parser was explicitly specified::reader._html_utils",
]
Expand Down
16 changes: 0 additions & 16 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def pytest_addoption(parser):

def pytest_collection_modifyitems(config, items): # pragma: no cover
apply_runslow(config, items)
apply_flaky_pypy_sqlite3(items)


def apply_runslow(config, items): # pragma: no cover
Expand All @@ -35,21 +34,6 @@ def apply_runslow(config, items): # pragma: no cover
item.add_marker(skip_slow)


def apply_flaky_pypy_sqlite3(items): # pragma: no cover
# getting intermittent sqlite3 errors on pypy;
# https://github.com/lemon24/reader/issues/199#issuecomment-716475686

if sys.implementation.name != 'pypy':
return

def rerun_filter(err, *args):
return issubclass(err[0], sqlite3.InterfaceError)

sqlite3_flaky = pytest.mark.flaky(rerun_filter=rerun_filter, max_runs=10)
for item in items:
item.add_marker(sqlite3_flaky)


def pytest_runtest_setup(item):
# lxml fails to build in various places,
# see the comments in setup.cfg for details.
Expand Down
1 change: 0 additions & 1 deletion tests/test_reader_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ def test_optimize_with(reader):
assert count_optimize_calls(statements) == 1


@pytest.mark.flaky(max_runs=5)
@pytest.mark.skipif("sys.implementation.name != 'cpython'")
@pytest.mark.slow
@rename_argument('reader', 'reader_shared')
Expand Down

0 comments on commit 8b9f49b

Please sign in to comment.