Skip to content

Commit bca75fb

Browse files
authored
Fix: CI doesn't fail even if autopep8 makes changes (appium#422)
* Fix: CI doesn't fail even if autopep8 makes changes * Fix: CI failure
1 parent 57fafcb commit bca75fb

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
rev: v1.4
33
hooks:
44
- id: autopep8
5-
args: ["--global-config", ".config-pep8", "-i"]
5+
args: ["-a", "--global-config", ".config-pep8", "-i"]
66
- repo: https://github.com/pre-commit/mirrors-isort
77
rev: v4.3.20
88
hooks:

appium/webdriver/extensions/applications.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ def app_strings(self, language=None, string_file=None):
177177
string_file (str): the name of the string file to query
178178
"""
179179
data = {}
180-
if language != None:
180+
if language is not None:
181181
data['language'] = language
182-
if string_file != None:
182+
if string_file is not None:
183183
data['stringFile'] = string_file
184184
return self.execute(Command.GET_APP_STRINGS, data)['value']
185185

ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

33

4-
if ! python -m autopep8 -r --global-config .config-pep8 -i . ; then
5-
echo "Please run command 'python -m autopep8 -r --global-config .config-pep8 -i .' on your local and commit the result"
4+
if ! python -m autopep8 --exit-code -a -r --global-config .config-pep8 -i . ; then
5+
echo "Please run command 'python -m autopep8 -a -r --global-config .config-pep8 -i .' on your local and commit the result"
66
exit 1
77
fi
88

test/unit/webdriver/device/location_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_set_location_without_altitude(self):
7575
d = get_httpretty_request_body(httpretty.last_request())
7676
assert abs(d['location']['latitude'] - 11.1) <= FLT_EPSILON
7777
assert abs(d['location']['longitude'] - 22.2) <= FLT_EPSILON
78-
assert d['location'].get('altitude') == None
78+
assert d['location'].get('altitude') is None
7979

8080
@httpretty.activate
8181
def test_location(self):

0 commit comments

Comments
 (0)