Skip to content

Commit

Permalink
Patch issue with os.rename on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioburdisso committed Feb 15, 2020
1 parent 6aac03e commit dfe8b95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ script:
- flake8 pyss3
- flake8 tests
- pytest tests

after_success:
- codecov
4 changes: 4 additions & 0 deletions pyss3/cmd_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,8 +1368,12 @@ def do_rename(self, args):

if rename:
if path.exists(rh_file):
if path.exists(rh_new_file):
remove_file(rh_new_file)
rename_file(rh_file, rh_new_file)
if path.exists(model_file):
if path.exists(model_new_file):
remove_file(model_new_file)
rename_file(model_file, model_new_file)
CLF.__name__ = args[0]
else:
Expand Down
7 changes: 4 additions & 3 deletions tests/test_cmd_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ def test_ss3prompt(mocker, monkeypatch):

# do_test
mocker.patch("matplotlib.pyplot.show")
cmd.do_test(dataset_path + " file")
cmd.do_test(dataset_path + " file") # cache
cmd.do_test(ArgsParserError)
if PYTHON3:
cmd.do_test(dataset_path + " file")
cmd.do_test(dataset_path + " file") # cache
cmd.do_test(ArgsParserError)

# do_k_fold
cmd.do_k_fold(dataset_path + " file 3-grams 3-fold")
Expand Down

0 comments on commit dfe8b95

Please sign in to comment.