File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,9 @@ def test_url_config_and_dict_config() -> None:
525525 assert memory_limit in ("500.0MB" , "476.8 MiB" )
526526
527527
528+ user_agent_re = r"duckdb/.*(.*) python(/.*)? duckdb_engine/.*(sqlalchemy/.*)"
529+
530+
528531@mark .skipif (
529532 supports_user_agent is False ,
530533 reason = "custom_user_agent is not supported for DuckDB version < 0.9.2" ,
@@ -536,7 +539,7 @@ def test_user_agent() -> None:
536539 res = conn .execute (text ("PRAGMA USER_AGENT" ))
537540 row = res .first ()
538541 assert row is not None
539- assert re .match (r"duckdb/.*(.*) python duckdb_engine/.*(sqlalchemy/.*)" , row [0 ])
542+ assert re .match (user_agent_re , row [0 ])
540543
541544
542545@mark .skipif (
@@ -551,9 +554,7 @@ def test_user_agent_with_custom_user_agent() -> None:
551554 res = conn .execute (text ("PRAGMA USER_AGENT" ))
552555 row = res .first ()
553556 assert row is not None
554- assert re .match (
555- r"duckdb/.*(.*) python duckdb_engine/.*(sqlalchemy/.*) custom" , row [0 ]
556- )
557+ assert re .match (user_agent_re + " custom" , row [0 ])
557558
558559 # Check that connect hasn't mutated the caller's data.
559560 assert connect_args ["config" ]["custom_user_agent" ] == "custom"
You can’t perform that action at this time.
0 commit comments