Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook test failing on Windows #86

Closed
asottile opened this issue Apr 3, 2021 · 3 comments
Closed

Hook test failing on Windows #86

asottile opened this issue Apr 3, 2021 · 3 comments

Comments

@asottile
Copy link
Member

asottile commented Apr 3, 2021

In GitLab by @christianmlong on Mar 11, 2015, 18:06

test_hooks.TestGitHook is failing on Python 2.7, 3.3, and 3.4 on Windows 8.1

Traceback (most recent call last):
  File "c:\python34\Lib\unittest\mock.py", line 1136, in patched
    return func(*args, **keywargs)
  File "C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_hooks.py", line 37, in test_prepends_tmp_directory_to_exclude
    style_guide.check_files.assert_called_once_with([tmpfile])
  File "c:\python34\Lib\unittest\mock.py", line 782, in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
  File "c:\python34\Lib\unittest\mock.py", line 771, in assert_called_with
    raise AssertionError(_error_message()) from cause
AssertionError: Expected call: check_files(['/fake/tmp\\:\\Users\\Me\\Documents\\Documents\\Computer\\Projects\\git\\flake8\\foo\\bfile.py'])
Actual call: check_files(['/fake/tmp\\foo\\bfile.py'])

I see two problems: the paths in the test have hardcoded posix path separators, and the path manipulation doesn't account for drive letters. I have a patch ready which I will PR soon.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Mar 11, 2015, 18:08

❤️

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @christianmlong on Mar 11, 2015, 18:11

mentioned in merge request !24

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Mar 11, 2015, 20:01

Status changed to closed by commit e8460df

@asottile asottile closed this as completed Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant