Skip to content

Commit

Permalink
test: use pytest-reruns instead of flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Mar 5, 2024
1 parent 3eef22c commit fad1532
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ dependencies:
- pytest >=3.6
- pytest-cov >=2.2.0
- pytest-mock
- pytest-rerunfailures
- setuptools-scm
- shellcheck
- typer
- typer-cli
- flaky
# docs
- pygments >=1.5
- sphinx
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ server =
tornado-m2crypto
importlib_resources
testing =
flaky
hypothesis
mock
parameterized
pytest
pytest-cov
pytest-mock
pytest-rerunfailures
pycodestyle

[options.entry_points]
Expand Down
3 changes: 1 addition & 2 deletions src/DIRAC/Core/Utilities/test/Test_Profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from subprocess import Popen

import pytest
from flaky import flaky

import DIRAC
from DIRAC.Core.Utilities.Profiler import Profiler
Expand Down Expand Up @@ -78,7 +77,7 @@ def test_base():
assert resWC["Value"] >= res["Value"]


@flaky(max_runs=10, min_passes=2)
@pytest.mark.flaky(reruns=10)
def test_cpuUsage():
mainProcess = Popen(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Test SubLogger
"""
import pytest
from flaky import flaky
from DIRAC.FrameworkSystem.private.standardLogging.LogLevels import LogLevels


Expand Down Expand Up @@ -52,7 +51,7 @@ def test_getSubLoggerObject():
# Run the tests for all the log levels and exceptions
# We may need to rerun the test if we are unlucky and the timestamps
# don't match
@flaky(max_runs=3)
@pytest.mark.flaky(reruns=3)
@pytest.mark.parametrize("logLevel", ["exception"] + [lvl.lower() for lvl in LogLevels.getLevelNames()])
def test_localSubLoggerObject(logLevel):
"""
Expand Down

0 comments on commit fad1532

Please sign in to comment.