Skip to content

Commit 564fc0e

Browse files
committed
Replace the custom test runners with pytest.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent cb00a29 commit 564fc0e

12 files changed

+12
-269
lines changed

.github/workflows/zulip-tests.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ jobs:
5252
name: Running Test-Suite on Linux
5353
run: |
5454
source zulip-api-py3-venv/bin/activate
55-
tools/test-main
55+
pytest --cov --cov-config=tools/.coveragerc --cov-report=xml
5656
5757
- if: runner.os == 'Windows'
5858
name: Running Test-Suite on Windows
5959
run: |
6060
zulip-api-py3-venv\Scripts\Activate.ps1
61-
tools\test-main.ps1
61+
pytest --cov --cov-config=tools\.coveragerc --cov-report=xml
6262
63-
- name: Codecov
64-
uses: codecov/[email protected]
63+
- uses: codecov/codecov-action@v2
64+
with:
65+
files: coverage.xml

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ and [commit guidelines](https://zulip.readthedocs.io/en/latest/contributing/vers
5959

6060
### Running tests
6161

62-
To run the tests for
62+
You can run all the tests with:
6363

64-
* *zulip*: run `./tools/test-zulip`
64+
`pytest`
6565

66-
* *zulip_bots*: run `./tools/test-lib && ./tools/test-bots`
67-
68-
* *zulip_botserver*: run `./tools/test-botserver`
66+
or test individual packages with `pytest zulip`, `pytest zulip_bots`,
67+
or `pytest zulip_botserver` (see the [pytest
68+
documentation](https://docs.pytest.org/en/latest/how-to/usage.html)
69+
for more options).
6970

7071
To run the linter, type:
7172

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
crayons
22
twine
3-
coverage>=4.4.1
43
black
54
isort
65
flake8
76
mock
87
pytest
8+
pytest-cov
99
-e ./zulip
1010
-e ./zulip_bots
1111
-e ./zulip_botserver

tools/.coveragerc

-6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,3 @@ exclude_lines =
1414

1515
[run]
1616
source = zulip, zulip_bots, zulip_botserver
17-
omit =
18-
# Parts of the test runner infrastructure
19-
tools/test-main
20-
tools/test-bots
21-
tools/test-botserver
22-
tools/test-zulip

tools/server_lib/__init__.py

Whitespace-only changes.

tools/server_lib/test_handler.py

-76
This file was deleted.

tools/test-bots

-144
This file was deleted.

tools/test-botserver

-6
This file was deleted.

tools/test-lib

-6
This file was deleted.

tools/test-main

-8
This file was deleted.

tools/test-main.ps1

-7
This file was deleted.

tools/test-zulip

-6
This file was deleted.

0 commit comments

Comments
 (0)