Commit aefa5a39 authored by Chris Lamb's avatar Chris Lamb 💬

Don't run our meta/self black source code reformatter test for versions...

Don't run our meta/self black source code reformatter test for versions earlier than 19.10b0 as it will generate different results.
parent 75ea5c39
Pipeline #87259 passed with stage
in 23 minutes and 13 seconds
......@@ -22,7 +22,7 @@ import glob
import diffoscope
import subprocess
from .utils.tools import skip_unless_tools_exist
from .utils.tools import skip_unless_tool_is_at_least
ALLOWED_TEST_FILES = {
# Data files we would prefer to generate dynamically
......@@ -238,7 +238,15 @@ ALLOWED_TEST_FILES = {
}
@skip_unless_tools_exist('black')
def black_version():
try:
out = subprocess.check_output(('black', '--version'))
except subprocess.CalledProcessError as e:
out = e.output
return out.decode('utf-8').rsplit(' ', 1)[-1]
@skip_unless_tool_is_at_least('black', black_version, '19.10b0')
def test_code_is_black_clean():
output = subprocess.check_output(
('black', '--diff', '.'), stderr=subprocess.PIPE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment