Skip to content

Commit 328f623

Browse files
authored
TST: run all tests (#473)
* TST: run all tests * close resource
1 parent 288f9df commit 328f623

6 files changed

+16
-18
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ ci:
33
autofix_prs: false
44
repos:
55
- repo: https://github.com/python/black
6-
rev: 22.8.0
6+
rev: 22.12.0
77
hooks:
88
- id: black
99
- repo: https://github.com/PyCQA/isort
10-
rev: 5.10.1
10+
rev: 5.11.2
1111
hooks:
1212
- id: isort
1313
- repo: https://github.com/asottile/pyupgrade
14-
rev: v3.2.0
14+
rev: v3.3.1
1515
hooks:
1616
- id: pyupgrade
1717
types_or: [python, pyi]
1818
types: [text] # overwrite types: [python]
1919
args: [--py38-plus]
2020
- repo: https://github.com/PyCQA/flake8
21-
rev: 5.0.4
21+
rev: 6.0.0
2222
hooks:
2323
- id: flake8
2424
name: flake8 (py)
@@ -27,7 +27,7 @@ repos:
2727
- id: flake8
2828
name: flake8 (pyi)
2929
additional_dependencies:
30-
- flake8-pyi==22.10.0
30+
- flake8-pyi==22.11.0
3131
types: [pyi]
3232
args: [
3333
--ignore=E301 E302 E305 E402 E501 E701 E704 F401 F811 W503 Y019 Y027 Y034 Y037 Y041 Y042,

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ python = ">=3.8,<3.12"
3535
types-pytz = ">= 2022.1.1"
3636

3737
[tool.poetry.dev-dependencies]
38-
mypy = "0.990"
38+
mypy = "0.991"
3939
pyarrow = ">=10.0.1"
4040
pytest = ">=7.1.2"
41-
pyright = "1.1.282"
41+
pyright = ">=1.1.284"
4242
poethepoet = "0.16.0"
4343
loguru = ">=0.6.0"
4444
pandas = "1.5.2"

tests/test_api_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def test_union_categoricals() -> None:
442442
check(assert_type(api.union_categoricals(to_union), pd.Categorical), pd.Categorical)
443443

444444

445-
def check_extension_dtypes() -> None:
445+
def test_check_extension_dtypes() -> None:
446446
# GH 315
447447
def check_ext_dtype(etype: Type[ExtensionDtype]):
448448
assert issubclass(etype, ExtensionDtype)

tests/test_frame.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2216,13 +2216,13 @@ def f(s: pd.DataFrame) -> pd.Series:
22162216
check(assert_type(resampler.apply(f), Union[pd.Series, pd.DataFrame]), pd.DataFrame)
22172217

22182218

2219-
def df_accepting_dicts_iterator() -> None:
2219+
def test_df_accepting_dicts_iterator() -> None:
22202220
# GH 392
22212221
data = [{"a": 1, "b": 2}, {"a": 3, "b": 5}]
22222222
check(assert_type(pd.DataFrame(iter(data)), pd.DataFrame), pd.DataFrame)
22232223

22242224

2225-
def series_added_in_astype() -> None:
2225+
def test_series_added_in_astype() -> None:
22262226
# GH410
22272227
df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
22282228
check(assert_type(df.astype(df.dtypes), pd.DataFrame), pd.DataFrame)

tests/test_io.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def test_types_read_table():
538538
df2: pd.DataFrame = pd.read_table(path, sep=",", converters=None)
539539

540540

541-
def btest_read_fwf():
541+
def test_btest_read_fwf():
542542
with ensure_clean() as path:
543543
DF.to_string(path, index=False)
544544
check(assert_type(read_fwf(path), DataFrame), DataFrame)
@@ -555,12 +555,10 @@ def btest_read_fwf():
555555
with open(path, "rb") as fwf_file:
556556
bio = io.BytesIO(fwf_file.read())
557557
check(assert_type(read_fwf(bio), DataFrame), DataFrame)
558-
fwf_iterator = read_fwf(path, iterator=True)
559-
check(assert_type(fwf_iterator, TextFileReader), TextFileReader)
560-
fwf_iterator.close()
561-
fwf_iterator2 = read_fwf(path, chunksize=1)
562-
check(assert_type(fwf_iterator2, TextFileReader), TextFileReader)
563-
fwf_iterator.close()
558+
with read_fwf(path, iterator=True) as fwf_iterator:
559+
check(assert_type(fwf_iterator, TextFileReader), TextFileReader)
560+
with read_fwf(path, chunksize=1) as fwf_iterator2:
561+
check(assert_type(fwf_iterator2, TextFileReader), TextFileReader)
564562

565563

566564
def test_text_file_reader():

tests/test_timefuncs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def test_iso_calendar() -> None:
257257
dates.isocalendar()
258258

259259

260-
def fail_on_adding_two_timestamps() -> None:
260+
def test_fail_on_adding_two_timestamps() -> None:
261261
s1 = pd.Series(pd.to_datetime(["2022-05-01", "2022-06-01"]))
262262
s2 = pd.Series(pd.to_datetime(["2022-05-15", "2022-06-15"]))
263263
if TYPE_CHECKING_INVALID_USAGE:

0 commit comments

Comments
 (0)