Skip to content

Commit

Permalink
Move mode init after mode selection; fixes #182
Browse files Browse the repository at this point in the history
  • Loading branch information
stevelacey committed Oct 29, 2024
1 parent a15236c commit 1fd00b8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pytest_picked/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def _get_affected_paths(config):
test_file_convention = config._getini("python_files") # pylint: disable=W0212

modes = {
"branch": Branch(test_file_convention, parent_branch),
"unstaged": Unstaged(test_file_convention),
"branch": (Branch, test_file_convention, parent_branch),
"unstaged": (Unstaged, test_file_convention),
}
try:
mode = modes[picked_mode]
Expand All @@ -53,8 +53,7 @@ def _get_affected_paths(config):
_write(config, [error])
config.args = []
raise ValueError(error)
else:
return mode.affected_tests()
return mode[0](*mode[1:]).affected_tests()


def pytest_configure(config):
Expand Down

0 comments on commit 1fd00b8

Please sign in to comment.