Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.10'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Tox
Expand Down
5 changes: 3 additions & 2 deletions tests/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest

pytest_plugins = ["pytester"]
IS_CI = os.getenv("CI", "false") == "true"


@pytest.fixture(
Expand Down Expand Up @@ -132,7 +133,7 @@ def test_basic_file_encoding_overwrite(testdir, basic_file, charset, ini_file):
assert expected in Path(file).read_text(encoding)


@pytest.mark.skipif(os.getenv("CI", False), reason="skip on CI")
@pytest.mark.skipif(IS_CI, reason="skip on CI")
def test_legacy_diff(testdir, capsys, basic_file, charset):
"""
Legacy test are supported to fail on Windows, when no encoding is provided.
Expand All @@ -158,7 +159,7 @@ def test_legacy_diff(testdir, capsys, basic_file, charset):
assert diff in stdout


@pytest.mark.skipif(os.getenv("CI", False), reason="skip on CI")
@pytest.mark.skipif(IS_CI, reason="skip on CI")
def test_legacy_overwrite(testdir, basic_file, charset):
"""
Legacy test are supported to fail on Windows, when no encoding is provided.
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ isolated_build = true

[testenv]
changedir = .tmp/{envname}
passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need this. CI isn't being registered in tox run. Nothing failed but also the tests that we want to skip were not getting skipped.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While passing CI, might as well pass a few other common ones.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we use none of those 🤷‍♀️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOME and WINDIR are common. LC doesn't hurt. If you don't like it, I can open follow-up PR to remove them. Lemme know.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for a pr. But I generally like to keep the config as clean as the code, no unused stuff to linger to make future us wonder about when their usage got removed and why, etc.

setenv =
numpydev: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
description = run tests
Expand Down