Skip to content

Tests break against python3-pygments (=2.10.0+dfsg-1) #234

Closed
@AlexGhiti

Description

@AlexGhiti

Hi,

We (Debian/Ubuntu) are updating python3-pygments to 2.10, but then it breaks pygments.rb package as reported here [1]. I tried to update the pygments.rb package to 2.2.0, and then the only remaining failures are related to UTF-8 expected encoding whereas ASCII is provided.

Could you give us a hand to fix those failures?

Thanks!

[1] https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1835947.html

Failure: test_lexer_by_content(PygmentsLexerTest)
/root/pygments.rb/test/test_pygments.rb:143:in `test_lexer_by_content'
     140:   end
     141: 
     142:   def test_lexer_by_content
  => 143:     assert_equal 'rb', P.lexer_name_for(RUBY_CODE)
     144:   end
     145: 
     146:   def test_lexer_by_nothing
<"rb">(UTF-8) expected but was
<"ruby">(ASCII-8BIT)

diff:
? ruby
  
? Encoding: UTF  -8   
?           ASCII  BIT
===========================================================================================================================================
F
===========================================================================================================================================
Failure: test_lexer_by_filename(PygmentsLexerTest)
/root/pygments.rb/test/test_pygments.rb:128:in `test_lexer_by_filename'
     125:   end
     126: 
     127:   def test_lexer_by_filename
  => 128:     assert_equal 'rb', P.lexer_name_for(filename: 'test.rb')
     129:     assert_equal 'scala', P.lexer_name_for(filename: 'test.scala')
     130:   end
     131: 
<"rb">(UTF-8) expected but was
<"ruby">(ASCII-8BIT)

diff:
? ruby
  
? Encoding: UTF  -8   
?           ASCII  BIT
===========================================================================================================================================
F
===========================================================================================================================================
Failure: test_lexer_by_filename_and_content(PygmentsLexerTest)
/root/pygments.rb/test/test_pygments.rb:139:in `test_lexer_by_filename_and_content'
     136:   end
     137: 
     138:   def test_lexer_by_filename_and_content
  => 139:     assert_equal 'rb', P.lexer_name_for(RUBY_CODE, filename: 'test.rb')
     140:   end
     141: 
     142:   def test_lexer_by_content
<"rb">(UTF-8) expected but was
<"ruby">(ASCII-8BIT)

diff:
? ruby
  
? Encoding: UTF  -8   
?           ASCII  BIT
===========================================================================================================================================
F
===========================================================================================================================================
Failure: test_lexer_by_mimetype(PygmentsLexerTest)
/root/pygments.rb/test/test_pygments.rb:123:in `test_lexer_by_mimetype'
     120:   RUBY_CODE = "#!/usr/bin/ruby\nputs 'foo'"
     121: 
     122:   def test_lexer_by_mimetype
  => 123:     assert_equal 'rb', P.lexer_name_for(mimetype: 'text/x-ruby')
     124:     assert_equal 'json', P.lexer_name_for(mimetype: 'application/json')
     125:   end
     126: 
<"rb">(UTF-8) expected but was
<"ruby">(ASCII-8BIT)

diff:
? ruby
  
? Encoding: UTF  -8   
?           ASCII  BIT
===========================================================================================================================================
F
===========================================================================================================================================
Failure: test_lexer_by_name(PygmentsLexerTest)
/root/pygments.rb/test/test_pygments.rb:133:in `test_lexer_by_name'
     130:   end
     131: 
     132:   def test_lexer_by_name
  => 133:     assert_equal 'rb', P.lexer_name_for(lexer: 'ruby')
     134:     assert_equal 'python', P.lexer_name_for(lexer: 'python')
     135:     assert_equal 'c', P.lexer_name_for(lexer: 'c')
     136:   end
<"rb">(UTF-8) expected but was
<"ruby">(ASCII-8BIT)

diff:
? ruby
  
? Encoding: UTF  -8   
?           ASCII  BIT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions