Skip to content

Commit cab705a

Browse files
authored
test: refactor tests and add more thorough linting / type checking
1 parent 4c73fb6 commit cab705a

40 files changed

+1151
-790
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
1010
// Append -bullseye or -buster to pin to an OS version.
1111
// Use -bullseye variants on local on arm64/Apple Silicon.
12-
"VARIANT": "3.10-bullseye",
12+
"VARIANT": "3.9-bullseye",
1313
// Options
1414
"NODE_VERSION": "none"
1515
}
@@ -41,6 +41,7 @@
4141
"ms-python.python",
4242
"ms-python.vscode-pylance",
4343
"bungcip.better-toml",
44+
"ms-vscode.makefile-tools",
4445
],
4546
// Use 'forwardPorts' to make a list of ports inside the container available locally.
4647
// "forwardPorts": [],

.dictionary

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: set python version
2626
uses: actions/setup-python@v4
2727
with:
28-
python-version: "3.10"
28+
python-version: "3.9"
2929

3030
- name: install poetry
3131
run: |

Makefile

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,53 @@
1-
# do any initial setup
2-
setup:
3-
poetry install
1+
.DEFAULT_GOAL = help
42

5-
# commands to run after git update
6-
update:
3+
bootstrap:
74
poetry install
85

9-
# commands as run by CI
10-
ci: lint
11-
HYPOTHESIS_PROFILE=slow poetry run pytest -vv --cov
12-
13-
# launch the interpreter in repl mode
14-
repl:
15-
poetry run python
6+
#: build the projects output files
7+
build: update
8+
poetry build
169

17-
lint:
10+
#: run continuous integration tasks
11+
ci:
1812
poetry run isort --check-only .
1913
poetry run black --check .
20-
poetry run pydocstyle
21-
poetry run pylint src/conjecture
22-
poetry run pylint --disable=missing-function-docstring,duplicate-code tests
23-
poetry run mypy --strict --pretty .
14+
HYPOTHESIS_PROFILE=slow poetry run pytest -vvv --mypy --pylint --pydocstyle --cov --typeguard-packages=conjecture,tests src tests
2415

25-
# run the tests locally
26-
test:
27-
poetry run pytest --testdox --cov --cov-report html
16+
clean:
17+
rm -rf .mypy_cache/ .pytest_cache/ .coverage dist
18+
19+
#: open a repl console
20+
console:
21+
poetry run python
22+
23+
docs: update
24+
exit
2825

29-
# automatically format codebase to pass linting rules
26+
#: format all source files
3027
format:
31-
poetry run isort --atomic .
32-
poetry run black .
28+
poetry run shed --refactor --py39-plus src/**/*.py tests/**/*.py
29+
30+
#: list avalible make targets
31+
help:
32+
@grep -B1 -E "^[a-zA-Z0-9_-]+\:([^\=]|$$)" Makefile \
33+
| grep -v -- -- \
34+
| sed 'N;s/\n/###/' \
35+
| sed -n 's/^#: \(.*\)###\(.*\):.*/make \2### \1/p' \
36+
| column -t -s '###' \
37+
| sort
38+
39+
#: run project server locally
40+
server: update
41+
exit
42+
43+
#: setup the project after a `git clone`
44+
setup: bootstrap
45+
46+
#: run the projects test suite
47+
test:
48+
poetry run pytest -vvv --mypy --pylint --pydocstyle --cov --cov-report term-missing --typeguard-packages=conjecture,tests src tests
49+
50+
#: update the project after a `git pull`
51+
update: bootstrap
3352

34-
.PHONY: setup update ci repl test format
53+
.PHONY: bootstrap build ci clean console docs format help server setup test update
File renamed without changes.

0 commit comments

Comments
 (0)