Skip to content

Commit cc233e4

Browse files
Fix up a few style errors, use WASM variable
1 parent 294ab6e commit cc233e4

File tree

8 files changed

+22
-10
lines changed

8 files changed

+22
-10
lines changed

pandas/tests/indexes/datetimes/methods/test_resolution.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from dateutil.tz import tzlocal
22
import pytest
33

4-
from pandas.compat import IS64, WASM
4+
from pandas.compat import (
5+
IS64,
6+
WASM,
7+
)
58

69
from pandas import date_range
710

pandas/tests/io/sas/test_sas7bdat.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
import numpy as np
88
import pytest
99

10-
from pandas.compat import IS64, WASM
10+
from pandas.compat import (
11+
IS64,
12+
WASM,
13+
)
1114
from pandas.errors import EmptyDataError
1215

1316
import pandas as pd

pandas/tests/io/test_common.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
import pytest
2121

2222
from pandas.compat import is_platform_windows
23+
import pandas.util._test_decorators as td
2324

2425
import pandas as pd
2526
import pandas._testing as tm
26-
import pandas.util._test_decorators as td
2727

2828
import pandas.io.common as icom
2929

@@ -230,7 +230,6 @@ def test_write_missing_parent_directory(self, method, module, error_class, fn_ex
230230
):
231231
method(dummy_frame, path)
232232

233-
234233
@td.skip_if_wasm # limited file system access on WASM
235234
@pytest.mark.parametrize(
236235
"reader, module, error_class, fn_ext",
@@ -592,6 +591,7 @@ def test_bad_encdoing_errors():
592591
with pytest.raises(LookupError, match="unknown error handler name"):
593592
icom.get_handle(path, "w", errors="bad")
594593

594+
595595
@td.skip_if_wasm # limited file system access on WASM
596596
def test_errno_attribute():
597597
# GH 13872

pandas/tests/io/xml/test_xml.py

+1
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ def test_empty_string_etree(val):
484484
with pytest.raises(ParseError, match="no element found"):
485485
read_xml(data, parser="etree")
486486

487+
487488
@td.skip_if_wasm # limited file system access on WASM
488489
def test_wrong_file_path(parser):
489490
filename = os.path.join("does", "not", "exist", "books.xml")

pandas/tests/scalar/timestamp/test_formats.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
import pytest
66
import pytz # a test below uses pytz but only inside a `eval` call
77

8-
from pandas import Timestamp
98
import pandas.util._test_decorators as td
109

10+
from pandas import Timestamp
11+
1112
ts_no_ns = Timestamp(
1213
year=2019,
1314
month=5,

pandas/tests/tseries/offsets/test_common.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ def test_apply_out_of_range(request, tz_naive_fixture, _offset):
131131
if tz is not None:
132132
assert t.tzinfo is not None
133133

134-
if isinstance(tz, tzlocal) and ((not IS64) or WASM) and _offset is not DateOffset:
134+
if (
135+
isinstance(tz, tzlocal)
136+
and ((not IS64) or WASM)
137+
and _offset is not DateOffset
138+
):
135139
# If we hit OutOfBoundsDatetime on non-64 bit machines
136140
# we'll drop out of the try clause before the next test
137141
request.applymarker(

pandas/tests/tslibs/test_parsing.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import pandas._testing as tm
2626
from pandas._testing._hypothesis import DATETIME_NO_TZ
2727

28+
2829
@td.skip_if_wasm # tzset is available only on Unix-like systems
2930
@pytest.mark.skipif(
3031
is_platform_windows() or ISMUSL,

pandas/util/_test_decorators.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ def test_foo():
2626

2727
from __future__ import annotations
2828

29-
import sys
30-
import platform
3129
import locale
3230
from typing import (
3331
TYPE_CHECKING,
@@ -41,6 +39,7 @@ def test_foo():
4139

4240
from pandas.compat import (
4341
IS64,
42+
WASM,
4443
is_platform_windows,
4544
)
4645
from pandas.compat._optional import import_optional_dependency
@@ -118,8 +117,8 @@ def skip_if_no(package: str, min_version: str | None = None) -> pytest.MarkDecor
118117
reason=f"Set local {locale.getlocale()[0]} is not en_US",
119118
)
120119
skip_if_wasm = pytest.mark.skipif(
121-
(sys.platform == "emscripten") or (platform.machine() in ["wasm32", "wasm64"]),
122-
reason="does not support wasm"
120+
WASM,
121+
reason="does not support wasm",
123122
)
124123

125124

0 commit comments

Comments
 (0)