Skip to content

Commit

Permalink
Use stestr again for unittests
Browse files Browse the repository at this point in the history
With the release of Python 3.12.1 we stopped using stest in CI because
3.12.1 introduced a breaking API change to the unittest runner API that
broke a dependency of stestr, testtools. This has been worked around
with a new testtools release so we can restore using stestr in CI again
which should improve test run throughput. This commit restores using
stestr for the test CI jobs and local runs. The cibuildwheel config
remains unchanged and uses the stdlib unittest runner still, just for
simplicity so we don't need to install additional test dependencies.
  • Loading branch information
mtreinish committed Jun 18, 2024
1 parent cdb2b2f commit 9469cff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "retworkx-%p-%m.profraw"
- name: Run tests
run: cd tests && python -m unittest discover . && cd ..
run: cd tests && stestr run && cd ..
env:
LLVM_PROFILE_FILE: "retworkx-%p-%m.profraw"
- name: Run grcov
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def install_rustworkx(session):
def base_test(session):
install_rustworkx(session)
session.chdir("tests")
session.run("python", "-m", "unittest", "discover", *session.posargs)
session.run("stestr", "run", *session.posargs)

@nox.session(python=["3"])
def test(session):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ passenv =
RUSTWORKX_DEBUG
changedir = {toxinidir}/tests
commands =
python -m unittest discover {posargs}
stestr run {posargs}
python -c "print('\nrustworkx no longer supports tox. Please run the equivalent comand with nox:\n\n\tnox -e test\n')"

[testenv:lint]
Expand Down

0 comments on commit 9469cff

Please sign in to comment.