Skip to content

Commit

Permalink
fix skip_on_windows marker
Browse files Browse the repository at this point in the history
  • Loading branch information
cristure committed Nov 5, 2024
1 parent 69404f0 commit c2adbf2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
shell: bash
run: |
export PYTHONPATH=.
pytest -m "run_on_windows" .
pytest -m "not skip_on_windows" .
- name: Run CLI tests
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-localnet-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ jobs:
- name: Test localnet dependent tests
run: |
pytest -m require_localnet multiversx_sdk_cli/tests
pytest -m require_localnet .
4 changes: 1 addition & 3 deletions multiversx_sdk_cli/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
# function executed right after test items collected but before test run
def pytest_collection_modifyitems(config, items):
if not config.getoption('-m'):
skip_me = pytest.mark.skip(reason="to run marked tests, you need to explicitly run them with -m")
skip_me = pytest.mark.skip(reason="require_localnet will only run if explicitly set to with -m")
for item in items:
if "require_localnet" in item.keywords:
item.add_marker(skip_me)
if "run_on_windows" in item.keywords:
item.add_marker(skip_me)
4 changes: 2 additions & 2 deletions multiversx_sdk_cli/tests/test_cli_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ def test_deps_check_testwallets():
assert return_code == 0


@pytest.mark.run_on_windows
@pytest.mark.skip_on_windows
def test_deps_install_all():
return_code = main(["deps", "install", "all"])
assert return_code == 0


@pytest.mark.run_on_windows
@pytest.mark.skip_on_windows
def test_deps_check_all():
return_code = main(["deps", "check", "all"])
assert return_code == 0
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pytest]
markers =
run_on_windows: marks tests as being skipped when running on windows (select with '-m "run_on_windows"')
skip_on_windows: marks tests as being skipped when running on windows (deselect with '-m "skip_on_windows"')
only: only run a specific test (run using: pytest -m "only")
require_localnet: marks tests that require a localnet (select with '-m "require_localnet"')

Expand Down

0 comments on commit c2adbf2

Please sign in to comment.