@@ -324,9 +324,7 @@ def test_table_without_schema(
324
324
# 2) HTML describing the indices
325
325
index_df_html = mock_display .call_args_list [1 ].args [0 ]
326
326
assert isinstance (index_df_html , HTML )
327
- assert (
328
- '<h2>Table <code>int_table</code> Indices</h2>' in index_df_html .data
329
- ) # title was projected.
327
+ assert '<h2>Indexes</h2>' in index_df_html .data # title was projected.
330
328
331
329
# Convert the HTML spelling of the indices back into a DF to test the output.
332
330
df_from_index_html = pd .read_html (index_df_html .data )[0 ]
@@ -380,9 +378,7 @@ def test_against_view(
380
378
html_obj = mock_display .call_args_list [1 ].args [0 ]
381
379
assert isinstance (html_obj , HTML )
382
380
html_contents : str = html_obj .data
383
- assert html_contents .startswith (
384
- '<br />\n <h2>View <code>str_int_view</code> Definition</h2>'
385
- )
381
+ assert html_contents .startswith ('<br />\n <h2>View Definition</h2>' )
386
382
# Some dialects include a 'CREATE VIEW' statement, others just start with 'select\n', and will vary by case.
387
383
matcher = re .compile (
388
384
'.*<pre>.*select.*s.str_id, s.int_col.*</pre>$' ,
@@ -420,9 +416,7 @@ def test_against_schema_qualified_view(self, sql_magic, ipython_namespace, mock_
420
416
html_obj = mock_display .call_args_list [1 ].args [0 ]
421
417
assert isinstance (html_obj , HTML )
422
418
html_contents : str = html_obj .data
423
- assert html_contents .startswith (
424
- '<br />\n <h2>View <code>public.str_int_view</code> Definition</h2>'
425
- ), html_contents
419
+ assert html_contents .startswith ('<br />\n <h2>View Definition</h2>' ), html_contents
426
420
427
421
@pytest .mark .parametrize (
428
422
'handle,schema' , [('@cockroach' , '' ), ('@cockroach' , 'public' ), ('@sqlite' , '' )]
@@ -445,9 +439,7 @@ def test_foreign_keys(self, sql_magic, ipython_namespace, mock_display, handle,
445
439
assert isinstance (fk_html , HTML )
446
440
html_contents : str = fk_html .data
447
441
448
- assert html_contents .startswith (
449
- f'<br />\n <h2>Table <code>{ qualified_references_int_table } </code> Foreign Keys</h2>'
450
- ), html_contents
442
+ assert html_contents .startswith ('<br />\n <h2>Foreign Keys</h2>' ), html_contents
451
443
452
444
# Convert the HTML table back to dataframe to complete test.
453
445
fk_df = pd .read_html (html_contents )[0 ]
@@ -502,9 +494,7 @@ def test_against_table_without_a_primary_key(self, sql_magic, ipython_namespace,
502
494
# Test test_constraints() will exercise this further. Only mention it here
503
495
# because will be returned and should not be talking about primary key / indices.
504
496
constraint_html = mock_display .call_args_list [1 ].args [0 ].data
505
- assert constraint_html .startswith (
506
- '<br />\n <h2>Table <code>str_table</code> Check Constraints</h2>'
507
- )
497
+ assert constraint_html .startswith ('<br />\n <h2>Check Constraints</h2>' )
508
498
509
499
# All CRDB tables have a primary key, so conditionally expect it to be described.
510
500
@pytest .mark .parametrize (
@@ -522,9 +512,7 @@ def test_constraints(
522
512
523
513
# The constraints HTML blob will be the final one always.
524
514
constraint_html = mock_display .call_args_list [- 1 ].args [0 ].data
525
- assert constraint_html .startswith (
526
- '<br />\n <h2>Table <code>str_table</code> Check Constraints</h2>'
527
- )
515
+ assert constraint_html .startswith ('<br />\n <h2>Check Constraints</h2>' )
528
516
529
517
# Convert back to dataframe
530
518
constraint_df = pd .read_html (constraint_html )[0 ]
0 commit comments