Skip to content

Commit 3c198ce

Browse files
committed
fix more tests
1 parent af28ebe commit 3c198ce

File tree

6 files changed

+20
-29
lines changed

6 files changed

+20
-29
lines changed

extensions/positron-python/python_files/posit/pinned-test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ torch==2.8.0; python_version < '3.14'
4747
scipy==1.13.1; python_version == '3.9'
4848
scipy==1.15.3; python_version == '3.10'
4949
scipy==1.16.2; python_version >= '3.11'
50-
snowflake-connector-python==3.17.4
50+
snowflake-connector-python==3.17.4; python_version < '3.14'
5151
SQLAlchemy==2.0.43
5252

5353
# putting this last like test-requirements.txt

extensions/positron-python/python_files/posit/positron/tests/test_inspectors.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,11 @@ def mutate(x):
643643

644644
@pytest.mark.skipif(geopandas is None, reason="geopandas is not available")
645645
def test_inspect_geopandas_dataframe() -> None:
646-
p1 = Polygon([(0, 0), (1, 0), (1, 1)])
647-
p2 = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
648-
p3 = Polygon([(2, 0), (3, 0), (3, 1), (2, 1)])
646+
p1 = Polygon([(0, 0), (1, 0), (1, 1)]) # type: ignore
647+
p2 = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]) # type: ignore
648+
p3 = Polygon([(2, 0), (3, 0), (3, 1), (2, 1)]) # type: ignore
649649

650-
value = geopandas.GeoDataFrame({"g": geopandas.GeoSeries([p1, p2, p3]), "data": [0, 1, 2]})
650+
value = geopandas.GeoDataFrame({"g": geopandas.GeoSeries([p1, p2, p3]), "data": [0, 1, 2]}) # type: ignore
651651

652652
rows, cols = value.shape
653653

@@ -725,11 +725,11 @@ def mutate(x):
725725

726726
@pytest.mark.skipif(geopandas is None, reason="geopandas is not available")
727727
def test_inspect_geopandas_series() -> None:
728-
value = geopandas.GeoSeries(
728+
value = geopandas.GeoSeries( # type: ignore
729729
[
730-
Polygon([(0, 0), (1, 0), (1, 1)]),
731-
Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]),
732-
Polygon([(2, 0), (3, 0), (3, 1), (2, 1)]),
730+
Polygon([(0, 0), (1, 0), (1, 1)]), # type: ignore
731+
Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]), # type: ignore
732+
Polygon([(2, 0), (3, 0), (3, 1), (2, 1)]), # type: ignore
733733
]
734734
)
735735
(rows,) = value.shape
@@ -889,11 +889,11 @@ def test_get_child(value: Any, key: Any, expected: Any) -> None:
889889
@pytest.mark.skipif(ibis is None, reason="ibis not available")
890890
def test_inspect_ibis_exprs() -> None:
891891
# Make sure we don't return an executed repr
892-
ibis.options.interactive = True
892+
ibis.options.interactive = True # type: ignore
893893

894894
test_df = pd.DataFrame({"a": [1, 2, 1, 1, 2], "b": ["foo", "bar", "baz", "qux", None]})
895895
_, columns = test_df.shape
896-
t = ibis.memtable(test_df, name="df")
896+
t = ibis.memtable(test_df, name="df") # type: ignore
897897
table_type = "ibis.Table"
898898

899899
verify_inspector(
@@ -933,7 +933,7 @@ def test_inspect_ibis_exprs() -> None:
933933
[
934934
(lambda: np.array([[1, 2, 3], [4, 5, 6]], dtype="int64"), 48),
935935
pytest.param(
936-
lambda: torch.Tensor([[1, 2, 3], [4, 5, 6]]),
936+
lambda: torch.Tensor([[1, 2, 3], [4, 5, 6]]), # type: ignore
937937
24,
938938
marks=pytest.mark.skipif(torch is None, reason="torch not available"),
939939
),
@@ -998,7 +998,7 @@ class VeryLongClassNameThatShouldDefinitelyBeTruncatedBecauseItIsWayTooLong:
998998
),
999999
pytest.param(lambda: np.ones((20, 20)), id="numpy_array"),
10001000
pytest.param(
1001-
lambda: torch.ones((20, 20)),
1001+
lambda: torch.ones((20, 20)), # type: ignore
10021002
id="torch_tensor",
10031003
marks=pytest.mark.skipif(torch is None, reason="torch not available"),
10041004
),

extensions/positron-python/python_files/posit/positron/tests/test_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_set_console_width(ui_comm: DummyComm) -> None:
105105
assert pd.get_option("display.width") is None
106106
assert pl.Config.state()["POLARS_TABLE_WIDTH"] == str(width)
107107
if torch is not None:
108-
assert torch._tensor_str.PRINT_OPTS.linewidth == width # noqa: SLF001
108+
assert torch._tensor_str.PRINT_OPTS.linewidth == width # noqa: SLF001 # type: ignore
109109

110110

111111
def test_open_editor(ui_service: UiService, ui_comm: DummyComm) -> None:

extensions/positron-python/python_files/posit/test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pytest-mock
2424
syrupy
2525
torch; python_version < '3.14'
2626
scipy
27-
snowflake-connector-python
27+
snowflake-connector-python; python_version < '3.14'
2828
sqlalchemy
2929

3030
# putting this last because holoviews is picky about dependency versions (including bokeh),

extensions/positron-python/src/test/common/platform/filesystem.functional.test.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
DOES_NOT_EXIST,
1414
fixPath,
1515
FSFixture,
16-
OSX,
1716
SUPPORTS_SOCKETS,
1817
SUPPORTS_SYMLINKS,
1918
WINDOWS,
@@ -469,12 +468,6 @@ suite('FileSystem - utils', () => {
469468
if (!SUPPORTS_SOCKETS) {
470469
this.skip();
471470
}
472-
// --- Start Positron ---
473-
// for some reason this fails only on macOS, which upstream does not test on but we do
474-
if (OSX) {
475-
this.skip();
476-
}
477-
// --- End Positron ---
478471
const sockFile = await fix.createSocket('x/y/z/ipc.sock');
479472

480473
const exists = utils.fileExistsSync(sockFile);
@@ -771,12 +764,6 @@ suite('FileSystem', () => {
771764
if (!SUPPORTS_SOCKETS) {
772765
this.skip();
773766
}
774-
// --- Start Positron ---
775-
// for some reason this fails only on macOS, which upstream does not test on but we do
776-
if (OSX) {
777-
this.skip();
778-
}
779-
// --- End Positron ---
780767
const sockFile = await fix.createSocket('x/y/z/ipc.sock');
781768

782769
const exists = fileSystem.fileExistsSync(sockFile);

extensions/positron-python/src/test/common/platform/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export const SUPPORTS_SYMLINKS = (() => {
2828
return true;
2929
})();
3030
export const SUPPORTS_SOCKETS = (() => {
31-
if (WINDOWS) {
31+
// --- Start Positron ---
32+
// Upstream doesn't run on OSX but that seems to fail too.
33+
// if (WINDOWS) {
34+
if (WINDOWS || OSX) {
35+
// --- End Positron ---
3236
// Windows requires named pipes to have a specific path under
3337
// the local domain ("\\.\pipe\*"). This makes them relatively
3438
// useless in our functional tests, where we want to use them

0 commit comments

Comments
 (0)