Skip to content

Commit

Permalink
test: fix fail_under regression
Browse files Browse the repository at this point in the history
  • Loading branch information
chohner authored and Pierre-Sassoulas committed Apr 7, 2021
1 parent b033f75 commit 8b18d91
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Pylint score: -6
Pylint score: -10
"""
import os

import nonexistent


Expand All @@ -11,6 +9,3 @@ def loop():
for i in range(5):
count += 1
print(count)

path = '/tmp'
os.path.exists(path)
8 changes: 0 additions & 8 deletions tests/regrtest_data/fail_under_plus6.py

This file was deleted.

9 changes: 9 additions & 0 deletions tests/regrtest_data/fail_under_plus7_5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
""""
pylint score: +7.50
"""

import os

def func():
path = '/tmp'
os.path.exists(path)
41 changes: 25 additions & 16 deletions tests/test_self.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,9 @@ def test_fail_under(self):
self._runtest(
[
"--fail-under",
"5",
"-10",
"--enable=all",
join(HERE, "regrtest_data", "fail_under_plus6.py"),
join(HERE, "regrtest_data", "fail_under_plus7_5.py"),
],
code=0,
)
Expand All @@ -663,55 +663,64 @@ def test_fail_under(self):
"--fail-under",
"6",
"--enable=all",
join(HERE, "regrtest_data", "fail_under_plus6.py"),
join(HERE, "regrtest_data", "fail_under_plus7_5.py"),
],
code=0,
)
self._runtest(
[
"--fail-under",
"5.5",
"7.5",
"--enable=all",
join(HERE, "regrtest_data", "fail_under_plus6.py"),
join(HERE, "regrtest_data", "fail_under_plus7_5.py"),
],
code=0,
)
self._runtest(
[
"--fail-under",
"7",
"7.6",
"--enable=all",
join(HERE, "regrtest_data", "fail_under_plus6.py"),
join(HERE, "regrtest_data", "fail_under_plus7_5.py"),
],
code=16,
)

self._runtest(
[
"--fail-under",
"6.7",
"-11",
"--enable=all",
join(HERE, "regrtest_data", "fail_under_plus6.py"),
join(HERE, "regrtest_data", "fail_under_minus10.py"),
],
code=16,
code=0,
)
self._runtest(
[
"--fail-under",
"-10",
"--enable=all",
join(HERE, "regrtest_data", "fail_under_minus10.py"),
],
code=0,
)

self._runtest(
[
"--fail-under",
"0",
"-9",
"--enable=all",
join(HERE, "regrtest_data", "fail_under_minus6.py"),
join(HERE, "regrtest_data", "fail_under_minus10.py"),
],
code=22,
)
self._runtest(
[
"--fail-under",
"-10",
"-5",
"--enable=all",
join(HERE, "regrtest_data", "fail_under_plus6.py"),
join(HERE, "regrtest_data", "fail_under_minus10.py"),
],
code=0,
code=22,
)

@staticmethod
Expand Down

0 comments on commit 8b18d91

Please sign in to comment.