Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit d620a31

Browse files
committed
Updated generate code for tests refactor. Related to Python-Markdown#333.
1 parent 1895fb4 commit d620a31

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

run-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
if len(sys.argv) > 2:
88
config = tests.get_config(os.path.dirname(sys.argv[2]))
99
root, ext = os.path.splitext(sys.argv[2])
10-
if ext == config.get(tests.get_section(os.path.basename(root), config), 'input_ext'):
10+
if ext == config.get(config.get_section(os.path.basename(root)), 'input_ext'):
1111
tests.generate(root, config)
1212
else:
1313
print(sys.argv[2], 'does not have a valid file extension. Check config.')

tests/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def TestSyntax():
136136

137137
def generate(file, config):
138138
""" Write expected output file for given input. """
139-
cfg_section = get_section(file, config)
139+
cfg_section = config.get_section(file)
140140
if config.get(cfg_section, 'skip') or config.get(cfg_section, 'normalize'):
141141
print('Skipping:', file)
142142
return None
@@ -146,7 +146,7 @@ def generate(file, config):
146146
os.path.getmtime(output_file) < os.path.getmtime(input_file):
147147
print('Generating:', file)
148148
markdown.markdownFromFile(input=input_file, output=output_file,
149-
encoding='utf-8', **get_args(file, config))
149+
encoding='utf-8', **config.get_args(file))
150150
else:
151151
print('Already up-to-date:', file)
152152

@@ -158,7 +158,7 @@ def generate_all():
158158
# Loop through files and generate tests.
159159
for file in files:
160160
root, ext = os.path.splitext(file)
161-
if ext == config.get(get_section(file, config), 'input_ext'):
161+
if ext == config.get(config.get_section(file), 'input_ext'):
162162
generate(os.path.join(dir_name, root), config)
163163

164164

0 commit comments

Comments
 (0)