Skip to content

Commit 4049f40

Browse files
mroeschkeim-vinicius
authored and
im-vinicius
committed
CI/TST: Misc test cleanups (pandas-dev#53931)
* TST: Misc testing cleanups * more cleans * pytest updates * trigger ci * Remove tmp_file removal * Revert gcs testing * type ignore
1 parent b27e073 commit 4049f40

File tree

7 files changed

+9
-41
lines changed

7 files changed

+9
-41
lines changed

.github/workflows/unit-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
ENV_FILE: ci/deps/${{ matrix.env_file }}
8282
PATTERN: ${{ matrix.pattern }}
8383
EXTRA_APT: ${{ matrix.extra_apt || '' }}
84-
LANG: ${{ matrix.lang || '' }}
84+
LANG: ${{ matrix.lang || 'C.UTF-8' }}
8585
LC_ALL: ${{ matrix.lc_all || '' }}
8686
PANDAS_COPY_ON_WRITE: ${{ matrix.pandas_copy_on_write || '0' }}
8787
PANDAS_CI: ${{ matrix.pandas_ci || '1' }}
@@ -122,7 +122,7 @@ jobs:
122122
- 5432:5432
123123

124124
moto:
125-
image: motoserver/moto:4.1.4
125+
image: motoserver/moto:4.1.12
126126
env:
127127
AWS_ACCESS_KEY_ID: foobar_key
128128
AWS_SECRET_ACCESS_KEY: foobar_secret

ci/code_checks.sh

-17
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,6 @@ BASE_DIR="$(dirname $0)/.."
2121
RET=0
2222
CHECK=$1
2323

24-
function invgrep {
25-
# grep with inverse exist status and formatting for azure-pipelines
26-
#
27-
# This function works exactly as grep, but with opposite exit status:
28-
# - 0 (success) when no patterns are found
29-
# - 1 (fail) when the patterns are found
30-
#
31-
# This is useful for the CI, as we want to fail if one of the patterns
32-
# that we want to avoid is found by grep.
33-
grep -n "$@" | sed "s/^/$INVGREP_PREPEND/" | sed "s/$/$INVGREP_APPEND/" ; EXIT_STATUS=${PIPESTATUS[0]}
34-
return $((! $EXIT_STATUS))
35-
}
36-
37-
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
38-
INVGREP_PREPEND="##[error]"
39-
fi
40-
4124
### CODE ###
4225
if [[ -z "$CHECK" || "$CHECK" == "code" ]]; then
4326

ci/run_tests.sh

+1-11
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,9 @@ export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 429496
88
# May help reproduce flaky CI builds if set in subsequent runs
99
echo PYTHONHASHSEED=$PYTHONHASHSEED
1010

11-
if [[ "not network" == *"$PATTERN"* ]]; then
12-
export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4;
13-
fi
14-
1511
COVERAGE="-s --cov=pandas --cov-report=xml --cov-append --cov-config=pyproject.toml"
1612

17-
# If no X server is found, we use xvfb to emulate it
18-
if [[ $(uname) == "Linux" && -z $DISPLAY ]]; then
19-
export DISPLAY=":0"
20-
XVFB="xvfb-run "
21-
fi
22-
23-
PYTEST_CMD="MESONPY_EDITABLE_VERBOSE=1 ${XVFB}pytest -r fEs -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET"
13+
PYTEST_CMD="MESONPY_EDITABLE_VERBOSE=1 pytest -r fEs -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET"
2414

2515
if [[ "$PATTERN" ]]; then
2616
PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\""

pandas/_testing/_io.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import bz2
44
import gzip
55
import io
6+
import pathlib
67
import tarfile
78
from typing import (
89
TYPE_CHECKING,
@@ -77,14 +78,12 @@ def round_trip_pathlib(writer, reader, path: str | None = None):
7778
pandas object
7879
The original object that was serialized and then re-read.
7980
"""
80-
import pytest
81-
82-
Path = pytest.importorskip("pathlib").Path
81+
Path = pathlib.Path
8382
if path is None:
8483
path = "___pathlib___"
8584
with ensure_clean(path) as path:
86-
writer(Path(path))
87-
obj = reader(Path(path))
85+
writer(Path(path)) # type: ignore[arg-type]
86+
obj = reader(Path(path)) # type: ignore[arg-type]
8887
return obj
8988

9089

pandas/tests/groupby/test_timegrouper.py

+1
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ def test_groupby_apply_timegrouper_with_nat_apply_squeeze(
907907
tm.assert_frame_equal(res, expected)
908908

909909
@td.skip_if_no("numba")
910+
@pytest.mark.single_cpu
910911
def test_groupby_agg_numba_timegrouper_with_nat(
911912
self, groupby_with_truncated_bingrouper
912913
):

pandas/tests/io/parser/test_network.py

-5
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ def tips_df(datapath):
7474

7575
@pytest.mark.single_cpu
7676
@pytest.mark.usefixtures("s3_resource")
77-
@pytest.mark.xfail(
78-
reason="CI race condition GH 45433, GH 44584",
79-
raises=FileNotFoundError,
80-
strict=False,
81-
)
8277
@td.skip_if_not_us_locale()
8378
class TestS3:
8479
@td.skip_if_no("s3fs")

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ disable = [
453453

454454
[tool.pytest.ini_options]
455455
# sync minversion with pyproject.toml & install.rst
456-
minversion = "7.0"
456+
minversion = "7.3.2"
457457
addopts = "--strict-data-files --strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml"
458458
empty_parameter_set_mark = "fail_at_collect"
459459
xfail_strict = true

0 commit comments

Comments
 (0)