Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit c3b05c2

Browse files
committed
Switch to pytest
1 parent cf7afb2 commit c3b05c2

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
pip install -e ".[dev]"
2222
- name: Run the tests
2323
run: |
24-
nosetests
24+
make test
2525
- name: Check type annotations (strict)
2626
run: |
27-
mypy --strict pantomime
27+
make check
2828
- name: Build a distribution
2929
run: |
3030
python setup.py sdist bdist_wheel

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
all: clean test dists release
33

44
test:
5-
nosetests --with-coverage --cover-package=pantomime --cover-erase --cover-html --cover-html-dir=coverage-report
5+
pytest --cov-report html --cov-report term --cov=pantomime tests/
6+
7+
typecheck:
8+
mypy --strict pantomime/
69

710
dists: clean
811
python setup.py sdist bdist_wheel

pantomime/parse.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from cgi import parse_header
22
from typing import Any, Dict, Optional, Tuple
33
from normality import stringify
4-
from normality.encoding import normalize_encoding
4+
from normality.encoding import tidy_encoding
55

66
from pantomime.types import DEFAULT, LABELS
77
from pantomime.mappings import REPLACE
@@ -44,8 +44,7 @@ def charset(self) -> Optional[str]:
4444
charset = self.params.get("charset")
4545
if charset is None:
4646
return None
47-
# return normalize_encoding(charset, default=None)
48-
return normalize_encoding(charset)
47+
return tidy_encoding(charset)
4948

5049
@classmethod
5150
def split(cls, mime_type: Optional[str]) -> Tuple[Optional[str], Optional[str]]:

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
package_data={"pantomime": ["py.typed"]},
3030
include_package_data=True,
3131
zip_safe=False,
32-
test_suite="nose.collector",
3332
install_requires=[
3433
"banal >= 0.3.5",
3534
"normality >= 0.5.6",
@@ -43,7 +42,8 @@
4342
"mypy",
4443
"black",
4544
"flake8>=2.6.0",
46-
"nose",
45+
"pytest",
46+
"pytest-cov",
4747
"banal",
4848
"coverage>=4.1",
4949
]

0 commit comments

Comments
 (0)