@@ -369,9 +369,9 @@ def test_simple_headerless_with_sep_line_with_padding_in_tablefmt():
369369 "Output: simple without headers with sep line with padding in tablefmt"
370370 expected = "\n " .join (
371371 [
372- "|------ |---------- |" ,
372+ "|: -----|---------: |" ,
373373 "| spam | 41.9999 |" ,
374- "|------ |---------- |" ,
374+ "|: -----|---------: |" ,
375375 "| eggs | 451 |" ,
376376 ]
377377 )
@@ -489,7 +489,7 @@ def test_github():
489489 expected = "\n " .join (
490490 [
491491 "| strings | numbers |" ,
492- "|----------- |----------- |" ,
492+ "|: ----------|----------: |" ,
493493 "| spam | 41.9999 |" ,
494494 "| eggs | 451 |" ,
495495 ]
@@ -506,7 +506,7 @@ def test_github_multiline():
506506 [
507507 "| more | more spam |" ,
508508 "| spam eggs | & eggs |" ,
509- "|-------------|- ------------|" ,
509+ "|------------:|: ------------|" ,
510510 "| 2 | foo |" ,
511511 "| | bar |" ,
512512 ]
@@ -515,6 +515,45 @@ def test_github_multiline():
515515 assert_equal (expected , result )
516516
517517
518+ def test_github_with_colalign ():
519+ "Output: github with explicit column alignment"
520+ expected = "\n " .join (
521+ [
522+ "| Name | Age |" ,
523+ "|:-------|------:|" ,
524+ "| Alice | 24 |" ,
525+ "| Bob | 19 |" ,
526+ ]
527+ )
528+ result = tabulate (
529+ [["Alice" , 24 ], ["Bob" , 19 ]],
530+ ["Name" , "Age" ],
531+ tablefmt = "github" ,
532+ colalign = ("left" , "right" ),
533+ )
534+ assert_equal (expected , result )
535+
536+
537+ def test_github_no_alignment ():
538+ "Output: github without alignment hints when numalign/stralign are disabled"
539+ expected = "\n " .join (
540+ [
541+ "| strings | numbers |" ,
542+ "|-----------|-----------|" ,
543+ "| spam | 41.9999 |" ,
544+ "| eggs | 451 |" ,
545+ ]
546+ )
547+ result = tabulate (
548+ _test_table ,
549+ _test_table_headers ,
550+ tablefmt = "github" ,
551+ numalign = None ,
552+ stralign = None ,
553+ )
554+ assert_equal (expected , result )
555+
556+
518557def test_grid ():
519558 "Output: grid with headers"
520559 expected = "\n " .join (
0 commit comments