Skip to content

Commit 337505d

Browse files
committed
use r"" strings for regular expressions
1 parent 5b3f1c4 commit 337505d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/bdd/steps/steps_db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def delete_table(context, table):
2525
cur.execute("DROP TABLE " + table)
2626

2727

28-
@then("table (?P<table>.+) has (?P<row_num>\d+) rows?(?P<has_where> with condition)?")
28+
@then(r"table (?P<table>.+) has (?P<row_num>\d+) rows?(?P<has_where> with condition)?")
2929
def db_table_row_count(context, table, row_num, has_where):
3030
assert table_exists(context.db, table)
3131

@@ -40,7 +40,7 @@ def db_table_row_count(context, table, row_num, has_where):
4040
f"Table {table}: expected {row_num} rows, got {actual}"
4141

4242

43-
@then("the sum of '(?P<formula>.+)' in table (?P<table>.+) is (?P<result>\d+)(?P<has_where> with condition)?")
43+
@then(r"the sum of '(?P<formula>.+)' in table (?P<table>.+) is (?P<result>\d+)(?P<has_where> with condition)?")
4444
def db_table_sum_up(context, table, formula, result, has_where):
4545
assert table_exists(context.db, table)
4646

tests/bdd/steps/steps_execute.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def setup_style_file(context, style):
148148
context.osm2pgsql_params.extend(('-S', str(context.test_data_dir / style)))
149149

150150

151-
@when("running osm2pgsql (?P<output>\w+)(?: with parameters)?")
151+
@when(r"running osm2pgsql (?P<output>\w+)(?: with parameters)?")
152152
def execute_osm2pgsql_successfully(context, output):
153153
returncode = run_osm2pgsql(context, output)
154154

@@ -160,7 +160,7 @@ def execute_osm2pgsql_successfully(context, output):
160160
f"Output:\n{context.osm2pgsql_outdata[0]}\n{context.osm2pgsql_outdata[1]}\n"
161161

162162

163-
@then("running osm2pgsql (?P<output>\w+)(?: with parameters)? fails")
163+
@then(r"running osm2pgsql (?P<output>\w+)(?: with parameters)? fails")
164164
def execute_osm2pgsql_with_failure(context, output):
165165
returncode = run_osm2pgsql(context, output)
166166

@@ -179,7 +179,7 @@ def execute_osm2pgsql_replication_successfully(context):
179179
f"Output:\n{context.osm2pgsql_outdata[0]}\n{context.osm2pgsql_outdata[1]}\n"
180180

181181

182-
@then("running osm2pgsql-replication fails(?: with returncode (?P<expected>\d+))?")
182+
@then(r"running osm2pgsql-replication fails(?: with returncode (?P<expected>\d+))?")
183183
def execute_osm2pgsql_replication_successfully(context, expected):
184184
returncode = run_osm2pgsql_replication(context)
185185

@@ -190,7 +190,7 @@ def execute_osm2pgsql_replication_successfully(context, expected):
190190
f"Output:\n{context.osm2pgsql_outdata[0]}\n{context.osm2pgsql_outdata[1]}\n"
191191

192192

193-
@then("the (?P<kind>\w+) output contains")
193+
@then(r"the (?P<kind>\w+) output contains")
194194
def check_program_output(context, kind):
195195
if kind == 'error':
196196
s = context.osm2pgsql_outdata[1]

0 commit comments

Comments
 (0)