Skip to content

Commit 6f2f11d

Browse files
committed
test infrastructure updates
Create a test dependency group that the CI and tox can use, move tox config to pyproject.toml, and use pytest to run tests.
1 parent 7a74332 commit 6f2f11d

File tree

3 files changed

+31
-19
lines changed

3 files changed

+31
-19
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
with:
4141
python-version: ${{ matrix.python-version }}
4242

43-
- name: Install Python Test dependencies
44-
run: pip install requests webob blinker httpx
43+
- name: Install package with test dependencies
44+
run: pip install --group test .
4545

4646
- name: Set the framework
4747
if: ${{ matrix.framework != 'NONE' }}
@@ -72,4 +72,4 @@ jobs:
7272
run: pip install fastapi==$FASTAPI_VERSION
7373

7474
- name: Run tests
75-
run: python -m unittest rollbar.test.discover
75+
run: pytest

pyproject.toml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
15
[project]
26
name = "rollbar"
37
dynamic = ["version"]
@@ -40,21 +44,38 @@ dependencies = [
4044
"requests>=0.12.1",
4145
]
4246

47+
[dependency-groups]
48+
test = [
49+
"blinker",
50+
"httpx",
51+
"pytest",
52+
"webob",
53+
]
54+
4355
[project.urls]
4456
Homepage = "https://rollbar.com/"
4557
Documentation = "https://docs.rollbar.com/docs/python"
4658
Changes = "https://github.com/rollbar/pyrollbar/blob/master/CHANGELOG.md"
4759
Source = "https://github.com/rollbar/pyrollbar/"
4860

49-
[build-system]
50-
requires = ["setuptools>=61.0"]
51-
build-backend = "setuptools.build_meta"
52-
53-
[tool.setuptools.dynamic]
54-
version = {attr = "rollbar.__version__"}
55-
5661
[project.scripts]
5762
rollbar = "rollbar.cli:main"
5863

5964
[project.entry-points."paste.filter_app_factory"]
6065
pyramid = "rollbar.contrib.pyramid:create_rollbar_middleware"
66+
67+
[tool.pytest]
68+
testpaths = [
69+
"rollbar/test",
70+
]
71+
72+
[tool.setuptools.dynamic]
73+
version = {attr = "rollbar.__version__"}
74+
75+
[tool.tox]
76+
requires = ["tox>=4.22"]
77+
78+
[tool.tox.env_run_base]
79+
dependency_groups = ["test"]
80+
description = "run unit tests"
81+
commands = [["pytest", "{posargs}"]]

tox.ini

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)