Skip to content

Commit

Permalink
#13 Add test order to avoid conflicts with env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsken committed Nov 20, 2024
1 parent ba21c05 commit eeb224f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@
)


@pytest.mark.order(index=1)
def test_can_show_help():
with pytest.raises(SystemExit) as error_info:
check_done_command(["--help"])
assert error_info.value.code == 0


@pytest.mark.order(index=2)
def test_can_show_version():
with pytest.raises(SystemExit) as error_info:
check_done_command(["--version"])
assert error_info.value.code == 0


@pytest.mark.order(after="test_config.py::test_can_resolve_root_repository_path")
@pytest.mark.order(index=3)
@pytest.mark.skipif(
not HAS_DEMO_CHECK_DONE_ORGANIZATION_PROJECT_CONFIGURED,
reason=REASON_SHOULD_HAVE_DEMO_CHECK_DONE_ORGANIZATION_PROJECT_CONFIGURED,
Expand All @@ -40,6 +42,7 @@ def test_can_set_root_dir_argument():
assert exit_code == 0


@pytest.mark.order(index=4)
@pytest.mark.skipif(
not HAS_DEMO_CHECK_DONE_ORGANIZATION_PROJECT_CONFIGURED,
reason=REASON_SHOULD_HAVE_DEMO_CHECK_DONE_ORGANIZATION_PROJECT_CONFIGURED,
Expand All @@ -52,6 +55,7 @@ def test_can_execute_check_done_command_and_get_warnings(caplog):
assert check_done_warning_messages >= 1


@pytest.mark.order(index=5)
@pytest.mark.skipif(
not HAS_DEMO_CHECK_DONE_ORGANIZATION_PROJECT_CONFIGURED,
reason=REASON_SHOULD_HAVE_DEMO_CHECK_DONE_ORGANIZATION_PROJECT_CONFIGURED,
Expand Down

0 comments on commit eeb224f

Please sign in to comment.